2 summary:: bind several value patterns to one existing event stream by binding keys to valueskeys to values
3 related:: Classes/Pattern, Classes/Event, Classes/Pbind, Classes/Pchain
4 categories:: Streams-Patterns-Events>Patterns>Composition
8 Pbindf adds several value streams into one existing event stream. Each value stream is assigned to one or more keys in the resulting event stream, overriding any values from the input stream.
10 The patterns bound to keys are referred to as value patterns and the Pbindf itself is termed an emphasis::event pattern::.
15 The arguments to Pbindf is the initial pattern followed by an alternating sequence of keys and patterns. A pattern can also be bound to an array of keys. In this case, the pattern must specify a sequence whose elements are arrays with at least as many elements as there are keys.
21 a = Pbind(\x, Pseq([1, 2, 3]), \zzz, 9000); // input stream
22 b = Pbindf(a, \y, Prand([100, 300, 200], inf), \zzz, 99);
26 x.next(()); // pass in an event ()
29 x.next(()); // end: nil
35 // using the default synth def
37 Pbindf(a, \freq, Prand([300, 500, 231.2, 399.2], inf)).play;
38 Pbindf(a, \freq, Prand([1, 1.2, 2, 2.5, 3, 4], inf) * 200).play;
43 SynthDef(\test, { | out, freq = 440, amp = 0.1, nharms = 10, pan = 0, gate = 1 |
44 var audio = Blip.ar(freq, nharms, amp);
45 var env = Linen.kr(gate, doneAction: 2);
46 OffsetOut.ar(out, Pan2.ar(audio, pan, env) );
50 a = Pbind(\instrument, \test, \dur, 0.1);
52 Pbindf(a, \freq, Prand([1, 1.2, 2, 2.5, 3, 4], inf) * 200).play;