runmix(1)

NAME
runmix - Automate music mixing with pianod(1).

SYNOPSIS
runmix [-cn] [mixplan]

DESCRIPTION
runmix evaluates and runs a mixplan. A mixplan is a simple declarative program that describes what Pandora stations to mix at particular times. Each line features a time in 24-hour format followed by a list of stations, separated by plus (+) signs. Times must be in chronological order or runmix considers it an error.

runmix allows 2 pseudo genres: start requests the player start playback at the specified time, and stop requests stopping at the specified time.

runmix also allows the Pandora account to be selected. This must occur as the first directive of the file with the keyword user instead of a time, followed by the pianod username. The requested user must have their Pandora credentials registered in pianod.

Comments are formed by hash/pound sign (#this is a comment) or using double-slash, //as in this form.

runmix assumes the plan starts today. If the first time is later in the day, it schedules playback to start then. If, however, there are mix definitions prior to the present time of day, they are ignored except for the single station set prior to the present time, which is selected immediately. Times may wrap past midnight once.

runmix uses at(1) to schedule station changes according to the mixplan.

OPTIONS

-n  Evaluate the mixplan without running it.

-c  Cancel mixing. This clears all future at(1) jobs, which may potentially affect other processes if they are using at(1) for scheduling.

PLATFORM SPECIFIC SUPPORT
MAC OS X
    Finder will launch shell scripts in a Terminal window if they have the extension command. runmix recognizes being invoked as runmix.command and presents a file dialog if invoked without parameters. Note runmix must be natively named runmix.command; a symbolic link will not work.

    If an mix is already scheduled (there are things in the at(1) queue), runmix lets the user choose between cancelling the existing mix, choosing a new one, or no action.

    When using runmix on OS X in any form, at(1) job processing must be enabled:

    sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.atrun.plist

ENVIRONMENT

PIANOD_HOST
    The pianod host to connect to.

PIANOD_PORT
    The port at which to connect to pianod.

PIANOD_USER
    The username to authenticate with.

PIANOD_PASSWORD
    The password with which to authenticate.

FILES
~/Music/Mixes
    Directory in which mixes are expected to be found on OS X. If the directory is not found, tries ~/Music, ~, and so forth back to /.

RETURN VALUES

0   if the mixplan is valid

1   if the mixplan is not valid

SEE ALSO
at(1), piano(1), pianod(1), football(3)

Example mixplans at deviousfish.com/pianod.

BUGS
The -c option will delete unrelated jobs from the at(1) queue.

Mixplans crossing two midnights won't work as expected.

AUTHOR
Perette Barella <perette@deviousfish.com>.

COPYRIGHT
Copyright Perette Barella. runmix is available under the MIT license.