The use of Boodler, in its simplest form, is, um, simple:
python boodler.py module.ClassName
...where module
is one of the files in
$BOODLER_EFFECTS_PATH
(without the .py
suffix), and ClassName is one of the Agent
classes
in that file. For example:
python boodler.py crows.ParliamentOfCrows
Most Agent
classes produce an unending stream of sound,
causing Boodler to run forever (or until you hit ctrl-C). Some
agents, however, come to a conclusion and shut themselves
down. If you tell Boodler to run such an agent, Boodler will exit
when the agent is finished.
Agent
classes take additional options, which you can
add to the command line after the class name. For example,
python boodler.py play.OneSound environ/droplet-bloink.aiff
play.OneSound
is an agent which takes exactly one argument --
the name of a sound -- and plays it once, and then exits. (The sound
is searched for in $BOODLER_SOUND_PATH
.)
play.OneSound
requires one argument -- you will get an error
if you try to pass none (or two or more).
Some Agent
classes, however, have optional arguments --
or both mandatory and optional arguments. If you try
python boodler.py play.OneSoundOpts environ/droplet-bloink.aiff...you will hear exactly the same "bloink" noise as in the previous example. However,
play.OneSoundOpts
takes up to three
additional arguments: the pitch, the volume, and the stereo (left-right)
shift. You may do
python boodler.py play.OneSoundOpts environ/droplet-bloink.aiff 0.5 0.75 -1.0...to hear this sound played an octave lower, at 75% volume, and shifted entirely to the left speaker channel.
Some Agent
classes take arguments which are themselves the
names of other Agent
classes. Try this:
python boodler.py manager.Simultaneous crows.ParliamentOfCrows wind.Windstorm
The manager.Simultaneous
agent takes as arguments any number
of Agent
classes; it sets them all playing at the same
time. In this case, you get a bunch of crows complaining about the blustery
weather.
(There is currently no way to pass arguments to any agents which are themselves arguments. You cannot, for example, say
python boodler.py manager.Simultaneous wind.Windstorm play.OneSound environ/droplet-bloink.aiff...because
manager.Simultaneous
will just think that
environ/droplet-bloink.aiff
is supposed to be a third
agent. I may come up with a way around this in some future release.
In the meantime, it is trivial to write your own agent which accomplishes
this simultaneity. See Designing New Soundscapes.)
--listen
argument. (If you do not, Boodler does not
listen for events, and event-receiving agents will not run.
This is the default behavior for reasons of security paranoia.)
To send an event, use
the boomsg.py
program:
python boomsg.py goThis sends a simple message
('go')
to a listening Boodler
process -- by default, on the same machine. To send a message to a
different machine, you would say:
python boomsg.py --hostname machine.addr.net goYou can also send a more complex message, with several words:
python boomsg.py go 5.47 cheeseThe effect of an event depends on what agent has been posted to receive it. For examples of Agent classes that receive events, see the
listen
module in the list of soundscapes.
python boodler.py [--device /dev/device] [--rate soundrate] [--master volume] [--verbose] [--hardware] [--stats interval] [--listen] [--port port] module.AgentClass [ data ... ]
--device /dev/device
/dev/dsp
.
--rate soundrate
--master volume
--verbose
--verbose
,
Boodler will print out the entire Python stack trace.
--hardware
--stats interval
--listen
--port port
--listen
is used, this causes Boodler to listen
on the given port number (instead of the default port 31863).
The port may also be an absolute pathname (beginning with "/"),
in which case Boodler uses a Unix domain socket instead of a network
socket.
--define opt
--define opt=val
--hardware
to show the driver details.)
Note that if an =val is supplied, there may not be any spaces
before or after the equals sign.
--define buffercount=count
--define buffersize=size
--define time=interval
--define end=big
--define end=little