Voices
== "polyphonic voice manager"
do you hear Voices? Most popular CLAP synths manage their own polyphony. This means that a single Anode instance can play multiple notes simultaneously.
With Hz, you can roll your own synthesizer from a network of modular components. If you do this you'll end up with mono-voice synthesizer. As soon as you hit two notes simultaneously you're in a pickle.
To work around this problem you can roll your own meta-synth in the form of an Anode chain and provide that template to
Voices
which duplicates this chain for a requested voice count. Now a voices instance can play the role of a polyphonic synth, assigning new notes to a quiescent subchain, aka voice. Typically all voices managed by voices are the same, but you can actually provide different graph chains to multipleAddVoices
for interesting (or not) results.These are the awesome deeds of
Voices
.
Voices
Voices
employs a voice-stealing
strategy that considers the note's MIDI key as well as the
pool's NoteOn/Off timestamps.Voices method | Description |
---|---|
AddVoices(voiceTemplateNode, num) |
Duplicates voicesTemplateNode 's subgraph num times. Sinces this changes the audio graph, it should be followed by await scene.Sync() |
Note(...), NoteOn(...) * |
These Anode methods assign a voice and return [noteid, voiceid] . |
SetVoiceParam(voiceid, node, paramId, value) * |
Distributes the SetParam to the duplicated node associated with voiceid |
NoteExpression(..., noteid), NoteChoke(...,noteid), MidiEvent(...., noteid) * |
These Anode methods distribute events to the voice associated with noteid . |
*
see Anode for method details.