Conductor provides a framework for defining interactive programs in terms of a collection of related components. The Conductor is a kind of Dictionary and its components are stored and accessed as dictionary entries (i.e., key/value pairs). This allows the Conductor to be configured either when it is first defined or in separate code.
The basic components of a Conductor are:
Conductor has the instance variables player, gui, and preset which respectively default to a ConductorPlayer, a ConductorGUI, and a CVPreset.
The messages spec_(specName, default)
and sp(default, lo, hi, step, warp)
can be used to set the range of values a CV can assume.
We can set the values and ranges of the CVs after creating the Conductor, if we want:
In this example, the CV assigned to d
is given an array as a default value.
The first argument of the function is set to the Conductor being constructed. Subsequent arguments are initalized as CVs; arguments with default values are set to instances of the class the default value specifies. Below, the first line defines a Conductor with four CV's assigned to the arguments a,b,c,d. The second line displays that Conductor.
Control.specs is a dictionary of ControlSpecs. When an argument in the make function is initialized to a CV, its identifier is looked up in this dictionary. If that does not provide a ControlSpec, the same identifier stripped of all of its numeric characters is used once again look-up. The specs dictionary is provided with the following defaults: amp, audiobus, beats, bipolar, boostcut, controlbus, db, dbamp, delay, detune, dur, fadeTime, fin, freq, i_out, in, lofreq, longdelay, midfreq, midi, midinote, midivelocity, out, pan, phase, rate, ratio, rq, unipolar, widefreq
an instance of ConductorGUI that defines the Conductor's GUI presentation
an instance of ConductorPlayer, which provides unified stop/play/pause/resume control for Patterns, Tasks, and, on the server, synths, groups, buses, and buffers. (These objects use a variant of Server-sendBundle to guarantee correct order execution on the server.)
an instance of CVPreset or CVInterpolator, this provides preset values for a user specified collection of CV's and Conductor's. The CVInterpolator allows interpolations between presets to be used for values.
stores the pathname of the file that saves the Conductor's settings and attempts to load those settings
an array of keys that determine the Conductor's response to value. (Typically includes both individual CV's and the CVPreset or CVInterpolator used by the Conductor.)
Adds an ActionPlayer which responds to play, stop, pause, and resume by evaluating the corresponding function with the Conductor as currentEnvironment.
Adds a which plays the function within a task scheduled by the specified clock and quantization. (On stop, tasks that block on a message port are also be deleted.)
Adds a PatternPlayer which plays the pattern with the specified event, clock and quantization.
Adds a NodeProxyPlayer, which uses the following bus, numChannels, and group if specified, otherwise uses default values. See NodeProxy for details.
Attaches a Synth to the Conductor, which creates Play and Pause buttons for it.
ev |
The events use the same keys as note events in patterns. The keys server, group, and addAction and, for synths, instrument determine the group or synth. As in patterns, the default values for these keys are: Usually the node ID of the group or synth is dynamically allocated, but the key id can be set to set the id directly. For group events, a new group or collection of groups is created with the specified id(s). For synth events, no synths are created, but the control values determined by the event are sent to the specified id(s). | ||||||||||
cvs |
The argument cvs is an interleaved array of keys and CVs (or value). CVs can also be altered before being sent to the server and combinations of CVs can determine the value to be sent:
|
CV's assigned to a group affect all of the synths within the group. In the following example the CV only alters playing synths, new synths use the default value:
ev |
See the description in synth, above. |
cvs |
See the description in synth, above. |
ev |
The event can specify:
| ||||
cvs |
An array of CVs that are used to determine the value of consecutive buses. |
ev |
This event is designed primarily for small waveform buffers, it specifies:
|
kvs |
An array of valueKeys. Assinging a new array iterates over the the array, assigning the value to be the value of the corresponding component identified by valueKeys. |
an array of the values of all components identified by valueKeys
A Conductor can load a set of initial settings for its contents from a file.
no file controls are displayed
allow a single set of settings to be saved to file and restored from file
Load the settings stored in the file identified by filePath.
path |
A path for the file. |
A CVPreset saves 'presets' for an array of CVs or other objects that respond to input and input_.
The objects at the keys will have their settings saved and restored by preset, which defaults to the object in the preset instance variable.
creates a CVPreset, gives it valueKeys as its default presetKeys
A CVInterpolator will set a specified set of CVs to values that derived from interpolating between two presets
The objects at the keys (which must be a subset of the valueKeys of the preset) can have their settings interpolated between preset values.
creates a CVInterpolator, sets valueKeys to be both presetKeys and interpKeys
Here is an example:
creates a CV, inserts it at key
in the Conductor and appends it to valueItems and, if it exists, presetItems
this will add a set of controls to enable linking individual CVs to MIDI continuous controllers
function |
The function receives a key number and velocity value and returns an object that responds to release (typically a Synth). |
MIDIchannel |
If MIDIchannel is nil, it responds to MIDI key commands from all channels in "omni" mode. |
Draw the Conductor within a window named argName at x,y with size w,h.
Draw the Conductor within the specified window. See ConductorGUI for more details.