2 summary:: incremental event pattern reference definition
3 categories:: Libraries>JITLib>Patterns
4 related:: Classes/Pdef, Classes/Pbind
7 Pbindef keeps a reference to a Pbind in which single keys can be replaced, combining link::Classes/PbindProxy:: and link::Classes/Pdef::. It plays on when the old stream ended and a new stream is set and schedules the changes to the beat.
9 the difference to Pdef is that it allows to incrementally change the elementary patterns (patternpairs) of a Pbind - also of an already existing Pbind inside a Pdef.
11 Pbindef inherits most methods from link::Classes/Pdef::. Overview: link::Overviews/JITLib::
16 store the pattern in the global dictionary of link::Classes/Pdef:: under key. (if there is already a Pdef there, replace its pattern with the new one. If there is already a strong::Pbindef:: there, set the parameters only, or add a new one (the whole pattern is replaced).
18 Using strong::*new(key):: you can access the pattern at that key (if none is there, a default pattern is created). see link::Classes/Pdef::.
24 SynthDef("Pdefhelp", { arg out, freq, sustain=1, amp=1, pan;
26 env = EnvGen.kr(Env.perc(0.01, sustain), 1, doneAction:2);
27 5.do { var d; d = exprand(0.01, 1); u = SinOsc.ar(d * 300, u, rrand(0.1,1.2) * d, 1) };
28 Out.ar(out, Pan2.ar(SinOsc.ar(u + 1 * freq, 0, amp * env), pan));
34 Pbindef(\a, \instrument, \Pdefhelp).play;
35 Pbindef(\a, \degree, Pseq([0, 2, 5b, 1b], inf));
36 Pbindef(\a, \dur, 0.1);
37 Pbindef(\a, \degree, Pseq([1b, 5, 3, 1b, 6, 2, 5, 0, 3, 0, 2], inf));
38 Pbindef(\a, \legato, Prand([1.0, 2.4, 0.2], inf), \mtranspose, -3);
39 Pbindef(\a, \mtranspose, nil); // remove key
41 Pbindef(\a, \degree, Pseq([1, 2, 3, 4, 5, 6], 1));
42 Pbindef(\a, \degree, Pseq([1, 2, 3, 4, 5, 6], 3), \dur, 0.02);
43 Pbindef(\a, \degree, Pseq([1, 2, 3, 4, 5, 6], 3), \dur, 0.1);
45 // apart from this Pbindef behaves like Pdef:
47 Pbindef(\a).quant = 0.0;
48 Pbindef(\a, \degree, Pseq([1, 2, 3, 4, 5, 6], 1));
51 Pbindef(\a, \degree, Pseq([1, 2, 3, 4, 5, 6], 1)); // does not resume now
53 Pbindef(\a).playOnce; // play single instance
54 Pseq([Pbindef(\a), Pdef(\a)]).play; // same here (Pdef(\a) is the same pattern as Pbindef))
56 Pbindef(\a) === Pdef(\a) // identical.
60 // an already existing Pdef can be incrementally changed
62 Pdef(\x, Pbind(\instrument, \Pdefhelp, \dur, 0.3));
65 Pbindef(\x, \degree, 7.rand);
66 Pbindef(\x, \degree, Pseq([0, 7, 3, 7, 4], inf), \dur, Pn(Pseries(0.2, -0.02, 10)));
67 Pbindef(\x, \stretch, 2);