SuperCollider: patterns and event sequencing
Learning objectives
- learner can sequence events with Pbind, pitch/scale/chord and tempo keys
- learner can compose and modify pattern streams live with the Pattern library
- learner can schedule concurrent streams on TempoClock with Routines and fork
Capstone — one whole task that evidences the objectives
Compose a SuperCollider piece driven by layered Pbinds (melody, chords, rests) playing custom SynthDefs, modify a running stream live with Pbindef/Pdefn, and schedule sectioned entrances with fork on a TempoClock.
Prerequisite modules
This module is where SuperCollider stops being a synthesizer and becomes a band. You already build custom SynthDefs; now you write the score that plays them — the declarative pattern layer that powers everything from generative ambient sets to on-stage algorave performance, where a piece must run, evolve, and change section without you ever touching a stop button.
The arc starts small: a single Pbind playing the default synth, understanding it as a score whose keyword streams (pitch, duration, amplitude) each pull from a pattern. From there you swap in your own instruments (Pbind can drive any custom SynthDef by naming it with \instrument), pick a pitch namespace deliberately (degree vs note vs midinote vs freq), and shape a real musical surface with named scales, nested-list chords, explicit Rest durations, and a TempoClock instead of the silent 60 BPM default. The pattern-generator trio — Pseq for ordered lines, Prand for constrained shuffle, Pwhite for continuous jitter — should become reflexive; they are drilled deliberately because live sets depend on swapping them without thinking.
The second half turns composition into performance: storing the EventStreamPlayer so streams can be stopped individually, then reaching for Pbindef and Pdefn to rewrite a single key or a shared value pattern while everything keeps running. Finally, fork on a TempoClock acts as the director, launching layered Pbinds with beat-accurate waits — exactly how the capstone’s sectioned entrances are built.
Every required atom is load-bearing for that capstone: pitch/chord/rest keys, the pattern vocabulary, live-modification proxies, and clock-driven scheduling all appear directly in it. Supporting atoms enrich rather than gate — random walks, per-event functions, wrapAt cycling, the Event type system, and perspective on why constrained live-coding languages emerged from this very pattern system.
Runnable examples
Generated from the context/ instrument corpus by concept (redistributable idioms only). Do not edit — regenerate with gen-module-examples.mjs.
random-walk-melody
Pbind(\degree, Pbrown(0, 7, 1, inf), \dur, 0.25).play
supercollider-0027 · CC0
@n = (@n || 0) + [-1, 0, 1].choose; play (scale :e3, :minor)[@n % 8]; sleep 0.25
sonicpi-0019 · CC0
chord-roll
d1 $ rolledBy 0.25 $ n "c'maj7" # sound "superpiano"
tidal-0053 · CC0
pattern-sequencing
Pbind(\degree, Pseq([0, 2, 4, 7], inf), \dur, 0.25).play
supercollider-0023 · CC0
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