home/ atoms/ sc-set-message

The .set message changes a running synth's arguments in real time while the synth continues playing

Arguments declared in a synth function via arg can be updated while the synth runs using .set: x.set(\freq, 880) changes frequency immediately without restarting. Multiple key/value pairs can be set in one call: x.set(\freq, 920, \amp, 0.2). Providing default values in the SynthDef is good practice — otherwise the synth starts with nil parameters and may not sound. The .set workflow is the foundation for real-time interaction, MIDI control, and GUI parameter mapping.

Examples

x = {arg freq=440, amp=0.1; SinOsc.ar(freq,0,amp)}.play;
x.set(\freq, 660);
x.set(\amp, 0.5);
x.set(\freq, 880, \amp, 0.2);
x.free;

Assessment

Create a synth with freq, amp, and cutoff arguments. Play it, then use three .set calls to change each parameter. Combine all three into one .set call.

“unctionareaccessiblebytheuser.Thisallowsyoutochangesynthpara”
corpus · a-gentle-introduction-to-supercollider-bruno-ruviaro · chunk 11
“messagesetis used for that purpose. Simple example: 1x = {arg freq = 440, amp = 0.1; SinOsc.ar(freq, 0, amp)}.play; 2x.set( req, 778);”
corpus · a-gentle-introduction-to-supercollider-ruviaro-archive-org-c · chunk 12