SuperCollider Patterns schedule streams of synthesis events algorithmically using Pbind and combinators
Patterns in SuperCollider are lazy, composable generators for event streams. Pbind is the core: it maps property names (\freq, \dur, \amp, \instrument) to Pattern values. Patterns like Pseq (cycle an array), Prand (random pick), Pxrand (no-repeat random), Pwrand (weighted random), and Pfunc (function) generate value sequences. A Pattern becomes a Stream via .asStream; EventStreamPlayer plays it in real time. Nested Patterns allow complex hierarchies. Ptpar/Ppar run multiple voices in parallel. Quantization via the quant argument syncs pattern start to a beat boundary. This system replaces manual scheduling with declarative specification of musical structure.
Examples
Pbind(\instrument, \sine,
\freq, Pseq([440,550,660,880], inf),
\dur, Prand([0.25,0.5,1.0], inf),
\amp, 0.2
).play;
Assessment
Write a Pbind that plays a melody from a scale array (Pseq), with rhythms from a weighted Pwrand, at an instrument you define as a SynthDef. Modify it live to transpose the melody up an octave without stopping playback.