Staccato parameter and group volume

Hi,
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 = Group.new;
Synth(\default,target:g);
Synth(\default, [\freq, 300], target:g);
g.set(\amp,0);

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 | ReplaceOut.ar(bus, In.ar( bus ) * amp.kr } - 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,
...
).play;

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

hjh

1 Like

Thanks for the overview of different cases.