Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to read a module playlist from a file/stdin? #25

Open
AliceLR opened this issue Feb 1, 2021 · 3 comments
Open

Option to read a module playlist from a file/stdin? #25

AliceLR opened this issue Feb 1, 2021 · 3 comments

Comments

@AliceLR
Copy link
Contributor

AliceLR commented Feb 1, 2021

Something I do a lot for getting aggregate data when testing fixes on more common module formats is I run checks on the ModLand or Mod Archive collections with a program that takes a list of newline-separated filenames. Doing a similar test with xmp --load-only would be useful to determine if anything new is rejected by libxmp after implementing a patch. If there's a way to do this with xmp without invoking multiple xmp processes, I missed it. (The ModLand 2016 dump I test with has >20k Impulse Tracker modules, for example, so while argv is fine for less common formats, it just isn't adequate in this case.)

Would a feature like this be generally useful?

@narodnik
Copy link

narodnik commented Mar 2, 2021

I'd like the ability to have a playlist. Right now I use this script:

#!/bin/bash

for i in $(fd --type f); do
    if rg $i played.txt; then
        echo "Skipping $i...";
    else
        xmp $i;
        echo $i >> played.txt
    fi
done

@iskamag
Copy link

iskamag commented Feb 3, 2022

I run "xmp ’shuf -n 100 modlist’"
You can probably save your playlist with "shuf -n 100 modlist > playlist" then run either "xmp ’cat playlist’" or "xmp ’head -n 1 playlist’ && sed -i 1d" for each line.
Scripting is awesome.

@narodnik
Copy link

I use these scripts:

#!/usr/bin/python
import os, glob, subprocess

HOME = os.environ["HOME"]
os.chdir(f"{HOME}/mus/shared/latest/")
files = glob.glob("**/*", recursive=True)
files = [f for f in files if os.path.isfile(f)]

played_files = open(f"{HOME}/mus/rec/all").read().split("\n")
files = [f for f in files if f not in played_files]
for file in files:
    with open(f"{HOME}/mus/rec/curr", "w") as f:
        f.write(file)
    process = subprocess.run(["xmp", file])
    with open(f"{HOME}/mus/rec/all", "a") as f:
        f.write(f"{file}\n")
#!/bin/sh
cat ~/mus/rec/curr >> ~/mus/rec/fav
echo >> ~/mus/rec/fav

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants