Using Voicer:
Filter:
ddwVoicer/Guides (extension) | Guides > Voicer

Using Voicer
ExtensionExtension

An introduction to the DDW Voicer class written by H. James Harkins, jamshark70@gmail.com
 

Description

This Guide contains information about using DDW Voicer. It organizes Voicer methods into three functional groupings: Playing, Controlling and Sequencing. For a complete description of Voicer’s features, Class and Instance methods, along with addition example code, please refer to the Voicer Class entry.

Playing

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

can be a single argument array, such as [\ffreq, 10000], or an array of arg arrays: [ [\ffreq, 10000], [\ffreq, 15000] ].

lat

Server latency -- see trigger1 / trigger below.

trigger1(freq, gate = 1, args, lat)

trigger(freq, gate = 1, args, lat)

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:

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

release1(freq, lat)

release(freq, lat)

Returns the node played, or a collection of nodes played.

gate1(freq, dur, gate = 1, args, lat)

gate(freq, dur, gate = 1, args, lat)

Find the earliest-triggered note(s) with the frequency/frequencies given and send [\gate,0] to it. release1 allows only one frequency to be given; release works with either a single value or a collection. If there is no node with a given frequency, that frequency is ignored.

Returns the node(s) released.

Triggers the 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.

releaseNow1(freq, sec)

releaseNow(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)

Controlling

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:

gui

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

mapGlobal(name, bus)

unmapGlobal(name, bus)

Makes an input to the Synth global, by using the supplied kr bus (or creating a new one if no bus is supplied) and mapping the input 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.

addProcess(states, type)

Adds a VoicerProcessGroup to this Voicer. The group will be displayed as a button or pop-up menu in the voicer's GUI. For a button, specify type as \toggle in the addProcess message. See the VoicerProcessGroup help file for the correct syntax for states. Returns the new process group.

This allows you to add graphically triggered sequencers and other processes directly to the Voicer GUI.

VoicerProcessGroups belong to the voicer's proxy, not to the Voicer itself. This means you can change the Voicer that is to play the sequence while the sequence is playing (provided both voicers use the same clock as the sequence). As with Voicer-gui, under normal circumstances this is transparent to the user.

VoicerProcesses and VoicerProcessGroups are deprecated and no longer maintained.

removeProcess(p)

Stops the process group if playing and removes it from the Voicer and GUI.

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.

Sequencing

Voicer adds two new events that can be used with event streams (Pbind):

\voicerNote:
an alternate event type in the standard event framework, except that instead of including \instrument, \synthdefName in the Pbind, you should include \voicer, myVoicerObject.
\voicerMIDI:
a completely separate event prototype optimized for working with MIDIRecBuf. Not as flexible for general use, but easier for MIDI.

You may also override note parameters individually: \freq is midi note number, \delta is \delta, \length corresponds to \sustain, and \gate corresponds to velocity.