SuperCollider: UGens, SynthDefs and synthesis
Learning objectives
- learner can build a UGen graph and wrap it in a reusable SynthDef
- learner can shape sound with envelopes, filters, and modulation/synthesis techniques
- learner can route audio on buses and control node ordering and lifecycle
Capstone — one whole task that evidences the objectives
Write a self-freeing SynthDef with an ADSR-gated envelope and a subtractive/FM voice, instantiate it as a Synth, route it through an effect Synth on an audio bus with correct node ordering, and control it live with .set.
Prerequisite modules
This module is where SuperCollider stops being a calculator that beeps and becomes an instrument you can gig with. The whole task is the anatomy of every serious SC rig — a techno bassline synth feeding a shared reverb, a drone set held open by a gate, an ambient pad retuned mid-piece — all of it reduces to one skeleton: a voice defined once as a SynthDef, spawned as nodes, wired through effect buses in the right order, and steered live. Get this skeleton wrong and you get the classic on-stage failures: silence because the effect reads its bus before the source writes, or a server choking on zombie nodes an hour into a set.
The arc starts supported: nest a couple of oscillators into a filter, hearing how “SuperCollider sounds are built from networks of Unit Generators wired by nesting” makes code mirror signal flow, and use the rate and polarity atoms plus “.range” rescaling as JIT references when a modulator misbehaves. Then freeze a working graph into a named recipe (“SynthDef names and stores a reusable synth recipe”), swap the fixed amplitude for an ADSR whose gate you open and close by hand, and add doneAction: 2 so notes clean up after themselves. The last supported step splits voice from effect across an audio bus, leaning on the node-ordering principle to place the effect after its source. The capstone then asks you to assemble the whole chain unaided.
Required atoms are exactly the gates: graph-building, envelope/gate lifecycle, subtractive and FM voicing, bus routing and execution order. Supporting atoms widen the palette afterward — multichannel expansion and alternate range-scaling approaches for more complex rigs, Groups and SynthDef conventions for bigger rigs, panning and Lag for polish, sample playback, additive and physical-modelling voices, and live input.
Runnable examples
Generated from the context/ instrument corpus by concept (redistributable idioms only). Do not edit — regenerate with gen-module-examples.mjs.
drone
osc 55 >> audio
punctual-0001 · CC0-1.0
SinOsc s => dac;
chuck-0001 · MIT
lowpass-sweep
Noise n => LPF f => dac; 0.2 => n.gain;
chuck-0003 · MIT
s("hh*8").lpf(sine.range(200,4000).slow(4))
strudel-0015 · CC0
adsr-envelope
note("c3").s("sawtooth").attack(0.01).decay(0.1).sustain(0.6).release(0.3)
strudel-0205 · CC0
{ Saw.ar(220) * EnvGen.kr(Env.perc(0.001, 0.2), Impulse.kr(2)) * 0.3 }.play
supercollider-0013 · CC0
fm-timbre
note("c3").s("sine").fm(4).fmh(2).fmi(3)
strudel-0204 · CC0
osc (midicps 24 * (1 ~~ 4 $ osc 110)) >> audio
punctual-0006 · CC0-1.0
modulated-range
s("hh*8").pan(sine.range(0,1).slow(2))
strudel-0037 · CC0
zoom (1 ~~ 2 $ osc 0.25) (circle 0 0.3) >> add
punctual-0022 · CC0-1.0
ring-modulation
osc 440 * osc 220 >> audio
punctual-0004 · CC0-1.0
{ (SinOsc.ar(440) * SinOsc.ar(221)) * 0.2 }.play
supercollider-0004 · CC0
stereo-panning
d1 $ pan (slow 2 sine) # sound "hh*8"
tidal-0037 · CC0
SinOsc s => Pan2 p => dac; -0.7 => p.pan;
chuck-0042 · MIT
additive-synthesis
{ Klang.ar(`[[100, 200, 300, 400], [0.4, 0.3, 0.2, 0.1]]) * 0.1 }.play
supercollider-0022 · CC0
generative-mutation
use_synth :prophet; play (scale :e3, :minor).choose + [0, 12].choose; sleep (ring 0.5, 0.25).choose
sonicpi-0045 · CC0
physical-modeling
Mandolin m => dac; 0.9 => m.pluck; 220 => m.freq;
chuck-0043 · MIT
Atoms in this module
Required — these gate the capstone
Supporting — enrichment, not gating
Part of curricula
- Live Coder — zero to performing live-coded music — Generative Systems & the SuperCollider Stack required
Unlocks — modules that require this one