I have stumbled into the almost classic problem of trying to control a
SynthDef with a known duration envelope with Patterns. I obviously get
the
“node not found”
error when Pbind tries to set \gate to 0 but the node is no longer
existing. Following a quick startpage.com research, I found this post by
Luka Learning SuperCollider patterns: legato, sustain and using pairs | Luka Prinčič
which recommends using the \sustain keyword in patterns.
I do now wonder:
Will Pbind only set \gate to 0 if such a control exists?
If there is another way to let Pbind know that setting \gate to 0 is not
needed or at least have it not complain about the node not being found?
What is the difference between using \dur together with \legato versus
using \sustain?
\sendGate
The default behavior for releasing a note is to look in the SynthDesc for an argument called \gate. If it’s present, the event will send a node.set(\gate, 0) message to the server. If not, no release will be sent; it’s assumed that the SynthDef will release itself after a given length of time. \sendGate overrides this behavior: true means to force the release message to be sent, whether or not the argument exists, while false means to suppress the release message.
So, if the SynthDef defines a gate control input, but the envelope ignores the gate, then you can set \sendGate, false in the pattern.
If the envelope is hardcoded into the SynthDef, then, just omit gate. This situation could arise if you’re passing the envelope as an arrayed control. Then, the def structure doesn’t know whether it’s a timed or a gated envelope – hence, can’t delete gate.