home/ atoms/ sc-pbind-pattern-sequencing

Pbind maps symbol-value pairs to a SynthDef's arguments, creating a timed stream of Synths

Pbind(key, valuePattern, …).play creates an EventStreamPlayer that instantiates one Synth per event. The \dur key controls inter-event delta time. Any SynthDef argument name can be a key. Values can be numbers, arrays, or patterns (Pseq, Pexprand, Pwhite, Prand, etc.) that generate a stream of values. Each event pulls the next value from each internal pattern. The stream stops when the shortest internal pattern is exhausted. Wrapping Pbind in Pdef gives it a name and allows live re-evaluation without stopping the stream.

Examples

Pdef(\pat, Pbind(\instrument, \sine, \dur, Pseq([0.6,0.15,0.15], inf), \freq, Pexprand(100,2000,inf), \amp, 0.1)).play(quant:1.875);

Assessment

A Pbind has a dur pattern with 3 repeats and a freq pattern with 5 repeats. How many events are generated before the stream stops? Why?

“Pbind expects a series of symbol-value pairs, also called key-value pairs”
corpus · supercollider-tutorials-full-transcripts-and-code-eli-fields · chunk 26