Voicer:
Filter:
Classes (extension) | Libraries > Voicer

Voicer
ExtensionExtension

A programmatically-controlled voice-stealing node manager
Location: NOT INSTALLED!
 

Description

Voicer provides a programming interface that is more like conventional synthesizers than the standard SuperCollider classes.

Standard SCVoicer
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.

Features

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:

NOTE: I had supported crucial-library Instr objects in the hope that they could modularize SynthDef construction, but it turns out they don't provide the infrastructure to do so polyphonically, at least not for Voicer's case. (The crucial library provides its own incompatible mechanism for that.) Syn and Plug are designed for this case. So in this help revision (5/2026) I am removing much of the documentation of more exotic Instr uses.

Class Methods

.new

Arguments:

voices

The maximum number of voices that can be played by this instance.

things

What should go into the nodes. This may be:

String or symbol
Treated as a SynthDef name.
Instr object
Creates an InstrVoicerNode.
\midi -> aMIDISender or just a MIDISender object
Creates a MIDIVoicerNode.
\syn -> string_or_symbol
Creates a SynVoicerNode (ddwPlug quark).

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 [\ffreq, 10000], or an array of arg arrays: [ [\ffreq, 10000], [\ffreq, 15000] ]. (A convenient way to produce an array of arrays is to .flop : [ffreq: [10000, 15000]].flop.

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 \syn -> defname style Voicers, the args should be valid in Synth() or Syn(). For \midi -> sender style, some keys are reserved for configuration. See Using Voicer: MIDI configuration args

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.

.parallelSynthGroup

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.)

NOTE: If using the ddwPlug quark with supernova, set as follows:

Inherited class methods

Instance Methods

.trigger1

.trigger

Arguments:

freq

in Hz

gate

default = 1

args

see above in *new

lat

see Discussion below

Discussion:

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:

Negative number / <0:
use the Voicer's default latency (set by myVoicer.latency = 1)
Non-negative number / >=0:
use this number as the latency for this event
nil
No latency: Server will play the message as soon as received

.set

Sends the same /n_set message to each node in this voicer. Global controls (see below) send the value to the associated kr bus.

Arguments:

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.

.release1

.release

Arguments:

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

Returns:

The voicer.

.gate1

.gate

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.

Arguments:

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).

Discussion:

.releaseNow1

.releaseNow

Arguments:

freq
sec

Discussion:

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)

.free

Removes all Synth objects associated with this voicer from the server, cleans up its GUI window, and disconnects the Voicer from MIDI.

.panic

Stops all active Synths belonging to this Voicer immediately.

.trace

Sends the n_trace message to all active synths. Useful for debugging SynthDefs. You can also trace a single playing node using the following:

.mapGlobal

.unmapGlobal

Arguments:

name
bus
value
spec
allowGUI

Discussion:

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.

.globalControls

Returns the IdentityDictionary of all global controls existing on this voicer.

.nodes

Returns the array of all nodes belonging to this voicer.

.playingNodes

Returns an array of active nodes belonging to this voicer.

.nonplaying

Returns an array of idle nodes belonging to this voicer, or, if all nodes are busy, returns the earliest activated node.

.sustainPedal

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.

Arguments:

sustain

True (sustain pedal on) or false (sustain pedal off).

.gui

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.

.stealer

Chooses the algorithm the voicer uses to find the next node to play. Your choices are:

\preferLate:
prefers nodes that were more recently played
\preferEarly:
the default setting; prefers nodes that were played longer ago
\random:
chooses a non-playing node at random
\cycle:
cycles through the nodes in sequence, skipping nodes that are playing
\strictCycle:
cycles through the nodes in sequence, always in order whether they're playing or not

.latency

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.

.run

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.

Arguments:

bool

True (run) or false (pause).

Inherited instance methods