ExtensionVoicer provides a programming interface that is more like conventional synthesizers than the standard SuperCollider classes.
| Standard SC | Voicer |
| Directly create and destroy nodes. | Central location to trigger, release or gate nodes. |
| You are responsible for tracking nodes. | Nodes are identified by frequency; no need to locate them yourself. |
| A rogue process can flood the server with nodes. | Voice stealing places an upper limit on server activity. |
| Control bus mapping must be manually applied for every note. | "Global controls" belong to the voicer and automatically apply to every note. |
| Syntaxes for Synth and MIDI are totally different. | One Voicer interface can talk to synths and MIDI devices or VST plugins (mostly) transparently. |
See Using Voicer for practical use cases.
SynthDefs & Instr's used with Voicer follow SC convention by using freq for frequency, gate for note onset/release, and out for output bus. The SynthDef's main volume envelope should specify doneAction: 2. Non-gated envelopes are supported, although note stealing requires a gate argument.
For example:
If you want the instrument to be velocity-sensitive, Latch the gate argument to get the velocity:
| voices |
The maximum number of voices that can be played by this instance. |
| things |
What should go into the nodes. This may be:
If an array of these entities is supplied, ***VoicerNodes will be created round-robin style. A Voicer's nodes need not point to the same synth or even be of the same type. |
| args |
can be a single argument array, such as NOTE: Argument arrays should always be written [name, value, name1, value1...] — even for Instr's. This is different from the standard crucial library usage.
For Synth and |
| bus |
the output bus to use. |
| target |
anything that responds to .asTarget. If you supply a MixerChannel, both the bus and the target will be set appropriately. Default is Server.local. |
| addAction |
where the Synths will be placed in relation to the target. This setting will be ignored by Patch nodes. |
A Boolean flag, indicating whether the Voicer should create a ParGroup and put its synths into this group, for parallel processing of polyphony. (Useful only in supernova.)
| freq |
in Hz |
| gate |
default = 1 |
| args |
see above in *new |
| lat |
see Discussion below |
Trigger a note (trigger1), or several notes (trigger). For trigger1, freq must be a float or int. For trigger, freq can be a single value or a collection. If you are triggering several notes, args can also be a collection of argument arrays e.g. [ [\filter, 300], [\filter, 500], [\filter, 700] ]. Each set of args will be sent in succession to the nodes as they're triggered (using wrapAt). In this case, the first node triggered will get \filter = 300, the second \filter = 500, etc.
lat is the server latency to use for this event. The following values are allowed for all methods with a "lat" argument:
Sends the same /n_set message to each node in this voicer. Global controls (see below) send the value to the associated kr bus.
| args |
See above in *new |
| lat |
Server latency -- see below in trigger1 / trigger. NOTE: Because of latency being appended as a final value, the argument list must be enclosed in an array. This is different from Node: -set. |
| freq |
In Hz, the frequencies of the note(s) you wish to release. These frequencies must be equal to the frequencies stored in the target nodes. (What about floating point rounding? This won't be a problem as long as the mapping from MIDI note numbers or scale degrees is deterministic.) |
| lat |
see trigger1 / trigger discussion above |
The voicer.
Triggers notes and schedules their releases. If freq is a collection, dur and args may be the same thing for every node, or you can supply collections to have different arguments and different release times for each node.
Returns the node(s) played.
| freq |
In Hz. |
| dur |
How many beats to sustain the note(s). |
| gate |
Default = 1. Also carries velocity information. |
| args |
As described in earlier methods. |
| lat |
Latency value (above). |
| freq | |
| sec |
Uses a negative gate to cause an instant release. Sec determines how long the release takes. Unlike gate, you may not supply a collection for sec. (Sec is converted to the negative gate by sec.abs.neg-1)
Removes all Synth objects associated with this voicer from the server, cleans up its GUI window, and disconnects the Voicer from MIDI.
Stops all active Synths belonging to this Voicer immediately.
Sends the n_trace message to all active synths. Useful for debugging SynthDefs. You can also trace a single playing node using the following:
| name | |
| bus | |
| value | |
| spec | |
| allowGUI |
Creates an input to the Synth global, by using the supplied kr bus or creating a new one if no bus is supplied; input is mapped to that bus in each Voicer node. Newly triggered Voicer nodes will be mapped automatically. This lets you control filter cutoff frequencies, pitch bends, etc. globally for all nodes in a Voicer. A kr Synth can be played on the bus to provide an LFO.
Returns the IdentityDictionary of all global controls existing on this voicer.
Returns the array of all nodes belonging to this voicer.
Returns an array of active nodes belonging to this voicer.
Returns an array of idle nodes belonging to this voicer, or, if all nodes are busy, returns the earliest activated node.
Toggles the sustain pedal. If true, note releases will be withheld until the sustain pedal becomes false again. If no argument is provided, the value will be toggled to the opposite setting.
| sustain |
True (sustain pedal on) or false (sustain pedal off). |
Creates a window showing all global controls (see mapGlobal) and processes (see addProcess).
Voicer-gui uses a proxy system so that you can display different Voicers without incurring the overhead of removing views, resizing the window, adding views, and resizing again. For normal use, this process is transparent to the user. To change the Voicer shown in a particular GUI, drag an expression that evaluates to the Voicer (usually a variable name) into the drag sink immediately to the right of the Voicer GUI label.
Chooses the algorithm the voicer uses to find the next node to play. Your choices are:
Sets the default latency for this Voicer. Default latency should be a positive number and can be overridden using the lat argument in trigger, release, gate, and set method calls.
Similar to Node: -run, if the Boolean flag is true, the nodes belonging to this voicer will be told to process audio. If false, they will be told to pause.
| bool |
True (run) or false (pause). |