Staccato parameter and group volume

Two questions in one:
1 – what is the best practice to manage the staccato effect (set with its duration) in a SynthDef ?
2 – how to set with a GUI for instance the “volume” of a specific group. I read this answer but it is still unclear to me and an example could help :slight_smile:

I solved the first question with the asr envelope:

~staccato={ |dur, synth| { dur.wait; synth.set(\gate,0)}.fork }

Still on the second question… what kind of synth should I add at the end of the chain?

couple ideas: if all the synths in your Group have an \amp control you can use the .set method on the group to set the volumes of all the synths in the group.

g =;
Synth(\default, [\freq, 300], target:g);

if you have a Group (with no antecedants!) where all the synths are outputting to the same Bus you can use something like
{ | bus amp |, bus ) * } - remember to addToTail !

1 Like

Note that the default Event prototype also auto-schedules a release:

(instrument: \yourSynthDefName,
sustain: gateOpenTime,  // in beats, e.g., 0.2 = 1/5 of a beat
paramName: value, otherParamName: value,

Alternately, you can use dur and legato and have sustain calculated for you (Pattern Guide 07: Value Conversions | SuperCollider 3.12.2 Help).


1 Like

Thanks for the overview of different cases.