randomplay1
Command-line based shuffle music player that remembers songs between sessions
Usage
randomplay [options]
[directory ...]
[file ...]
Options: --help
brief
help
message
--man
full
man
page
--version
show
the
version
number
and
exit
-q,
--quiet
quiet
output:
don't
report
name
of
each
song
as
it
is
played
-v,
--verbose
verbose
output:
include
output
from
player
program
on
console
-d
n,
--days=n
minimum
days
since
track
was
last
played
for
it
to
be
considered
(default
10
days)
track information
is
piped
into
program
set to
a
blank
string
if
you
don't
want
any
on
screen
announcements
Default keys
while
playing:
f skip
to
the
next
song
b skip
to
the
previous
song
p pause
the
playback
(toggle)
l quit
randomplay
after
the
current
song
is
finished
q quit
randomplay
Overview
randomplay is a shuffle music file player with a memory across sessions. randomplay also can remember which songs you like better and weight them more heavily in the random shuffle. It can also be used to play a directory or set of directories nonrandomly, remembering where you left off between seessions. You can specify any number of directories to be recursively searched for music files, as well as how long since a track was last played for it to re-enter the rotation. You can also keep track of different playlist histories (for example, for different users of the same account) by specifying a different history filename. All options can also be kept in ~/.randomplayrc, with one option per line, option name followed by a space followed by the option value. Command line settings will override settings specified in ~/.randomplayrc; later settings will override earlier settings. There is a default randomplayrc that comes with this package and includes all possible settings.
Examples
Play all ogg files in dir1 and dir2 under your home directory, and dir3 under the base directory specified in ~/.randomplayrc, which have not been played for 15 days in random order with 5 seconds between songs:
randomplay --days=15 --pause=5 --player ogg=ogg123 ~/dir1 ~/dir2 =dir3
Play all ogg, wav, and mp3 files under the current directory (or base directory, if specified in .randomplayrc file) which have not been played for 10 days in alphabetical order, switch the 'skip to next song' keystroke to 'G' or 'g' and 'quit' to 'q' or 'c':
randomplay --norandom --key next=Gg --key quit=qc
Play all files under the current directory with the strings "frisell" and "bill" in the filename, in any order, (saves having to hunt down a file in a hierarchy), ignore whether the file has been played recently, but stop playing after 15 minutes:
randomplay --regexp 'frisell bill' -0 --maxtime=15m
Display 100M worth of music files, randomly sorted, without recording the history of tracks, using the default music directory (or the current directory if not specified):
randomplay --maxsize=100M --noremember --names-only
Play the last 10 songs played over again:
randomplay --last=10
Play songs test.ogg, test2.ogg, test3.ogg, and all files in musicdir in random order without weighting preferred songs:
randomplay --noweight test.ogg test2.ogg test3.ogg musicdir
Copy 128M of songs into a Neuros Audio Player, using positron:
positron add `randomplay --names-only --maxsize=128M`
Pick a random jpeg or png file that has not been displayed in the last week from the 'images' directory and display it with ImageMagick 'display' command:
randomplay --player jpg=display --player gif=display --days 7 ~/images
Notes
Most options can be abbreviated as a single letter; e.g., -t for --tracks, -d for --days, -r for --regexp. You can also omit the "=" sign between the option and the value if you prefer. If many options start with the same letter (e.g., --maxtime, --maxsize), then you must use the full name for the option.
For maxsize, you can use "k" for kilobytes and "m" for megabytes, or just enter the number of bytes.
For maxtime, you can use "s" for seconds (default units), "m" for minutes, "h" for hours, or "d" for days.
You might want to specify a "basedir" setting in your .randomplayrc, if all your music is under a certain directory. Then you can just give the relative names of the directories on the command line--e.g., you have "basedir=~/music" in ~/.randomplayrc, and rock is a directory under ~/music, so just enter "randomplay rock".
Randomplay will search for music in specified subdirectories first under the current working directory, and then relative to the basedir setting, if any. If the specified directory name begins with =, it will be searched relative to the basedir setting, even if the specified directory also exists under the current working directory.
Spaces in regexps are turned into "ands," making it more convenient to find the files you want. For example, --regexp 'thelonious monk blues' will play all songs with the words thelonious, monk, and blues in the filename, regardless of the order in which those words occur. Regexp searching is case-insensitive.
If you specify an extension and a player for that extension, either in ~/.randomplayrc or on the command-line, only files with that extension will be played. You can, however, specify multiple players/extensions in either place, and all extensions listed will be played.
The --last option implies --norandom and --noremember.
Releases
11 releases since Debian 3.1 (Sarge); the text changed 5 times.