The use of Boodler, in its simplest form, is, um, simple:
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:
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,
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
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
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:
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
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:
boomsg.py go
This 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:
boomsg.py --hostname machine.addr.net go
You can also send a more complex message, with several words:
boomsg.py go 5.47 cheese
The 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.
boodler.py --list-drivers
You can adjust the behavior of each driver with various command-line
arguments. Most understand the --rate
and
--device
arguments (although the meaning of the latter
depends on the driver). Some drivers also accept additional arguments,
using the --define opt
or
--define opt=val
command-line arguments. (Use
--hardware
to show the driver details.)
Boodler currently offers these drivers:
file
-- write file containing raw sample output--device
.
The file will contain raw PCM sound sample data, two channels, 16 bits
per sample, signed (centered at 0). By default the samples will be
in the native endianness of your computer, but you can change this with
--define end=big
or --define end=little
.
This driver limits the size of the file. By default, it will only write
five seconds of sound data; you can change the limit with the
--define time=interval
option. If the
sound agent stops before the time limit, you'll get a shorter file.
(Note that this driver writes to the file as quickly as possible. It probably won't take five seconds to generate a five-second sound file.)
--define time=interval
--define end=big
--define end=little
stdout
-- write raw sample output to stdoutfile
driver, but it streams its
data to stdout, and there is no time limit. The
--device
argument is ignored.
The stdout
driver, like the file
driver,
generates sound data as quickly as possible. This will probably
be much faster than real time! If you pipe the output to a file,
you will have a very large file very soon. This driver is intended
to be piped to an application that can regulate its input, such as
Ices.
--define end=big
--define end=little
oss
-- Open Sound System--device
to control which audio hardware device
is used; the default is /dev/dsp
.
alsa
-- Advanced Linux Sound Architecture--device
to control which
ALSA device is used; the default is default
.
--define buffersize=frames
--define hwbuffer=frames
--define periodsize=frames
esd
-- Enlightened Sound Daemon--device
option defines
the hostname to send sound to; it defaults to localhost
.
If no ESD daemon is running, this will attempt to write directly to
/dev/dsp
.
macosx
-- MacOSX CoreAudio
--define buffercount=count
--define buffersize=size
vorbis
-- write Ogg Vorbis filefile
driver; but it
generates an Ogg Vorbis file. The default filename is "boosound.ogg".
To change this, pass a filename as the --device
.
--define time=interval
--define quality=val
shout
-- Shoutcast or Icecast source
--define shout-server=name
--define shout-port=port
--define shout-user=name
--define shout-password=password
--define shout-mount=mount
--define shout-protocol=type
--define quality=val
lame
-- write MP3 file with LAME encoderfile
driver; but it
generates an MP3 file. The default filename is "boosound.mp3".
To change this, pass a filename as the --device
.
--define time=interval
--define quality=val
--define fast
--define abr=rate
--define haste=val
boodler.py [ options ] module.AgentClass [ data ... ]
--output driver
oss
on Unix, or macosx
on
MacOSX.
--list-drivers
--output
option.
--device device
--list-devices
--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