home/ atoms/ sonic-pi-control-synth

play, synth, and sample return a SynthNode reference that enables post-trigger parameter changes

Capturing the return value of play, synth, or sample in a variable gives a SynthNode reference. The control fn changes the running synth’s parameters while it plays. Envelope opts cannot be changed post-trigger; amplitude, note, cutoff, pan and other controllable opts can be changed. This is distinct from triggering multiple synths: one call creates one sound, and control morphs it. The pattern enables complex gestures (filter sweeps, pitch bends, pan motion) with minimal resource use.

Examples

sn = synth :prophet, note: :e1, release: 8, cutoff: 100 sleep 1 control sn, cutoff: 130

Assessment

Trigger a long-release synth, then use control three times over 4 beats to sweep its cutoff from 60 to 120. Explain why you cannot use control to extend the release time.

“not triggering 4 different synths here - we're just triggering one synth and then change the pitch 3 times afterwards”
corpus · sonic-pi-built-in-tutorial · chunk 16
“SynthNode` which represents a running sound. You can capture one of these `Synth”
corpus · sonic-pi-built-in-tutorial · chunk 41