home/ atoms/ sc-group-set-broadcast

Sending set to a Group broadcasts the message to all contained Synths simultaneously

Groups are collections of Synth nodes on the SuperCollider server. Sending .set(\arg, val) to a Group causes the server to relay that message to every Synth within the group. This is more efficient than iterating and setting individual Synths from the language side, and it applies the change more simultaneously. Groups can also be freed with .freeAll, which removes all nodes the group contains in one server command. This pattern is especially useful for textures where many Synths share a global parameter like density, decay time, or fundamental pitch.

Examples

8.do { Synth.new(\blip, [\fund, exprand(60,300)], ~sourceGrp) }; ~sourceGrp.set(\decay, 0.05); ~sourceGrp.freeAll;

Assessment

You have a group containing 20 active Synths. Write one line to set their amplitude to 0.1. Then write one line to remove all of them from the server.

“using iteration, I'll create 8 instances of this SynthDef, making sure to add them to the correct Group”
corpus · supercollider-tutorials-full-transcripts-and-code-eli-fields · chunk 18