2 summary:: instantiate new patterns from a function
3 related:: Classes/Plazy, Classes/PlazyEnvirN, Classes/Pfunc
4 categories:: Streams-Patterns-Events>Patterns>Function
8 Evaluates a function that returns a pattern and embeds it in a stream. In difference to link::Classes/Plazy::, the function is evaluated using the environment passed in by the stream.
15 A link::Classes/Function:: that returns a pattern or any other valid pattern input.
21 a = PlazyEnvir({ arg a=0, b=1; Pshuf([a, a, b], 2) }); // a, b default to 0,1
22 x = Pn(a, inf).asStream;
24 10.do { x.next.postln }; Post.nl;
26 10.do { x.next(e).postln }; Post.nl;
28 10.do { x.next(e).postln };
32 //PlazyEnvir used to produce a Pbind:
35 SynthDef(\help_sinegrain,
36 { arg out=0, freq=440, sustain=0.05, pan=0;
38 env = EnvGen.kr(Env.perc(0.01, sustain, 0.2), doneAction:2);
39 Out.ar(out, Pan2.ar(SinOsc.ar(freq, 0, env), pan))
42 a = PlazyEnvir({ arg g=0, h=0, dur=1;
43 postf("g: %, h: %, dur: %\n", g, h, dur);
45 \instrument, \help_sinegrain,
47 \degree, Pseq([g, g, h, g, h], 2)
53 (a <> (g: 0, h: 3, dur:0.2)).play; // single stream
54 (a <> (g: [0, 4], h: [3, -1], dur:0.2)).play; // same durations, two streams
57 For more about the composition operator code::<>:: see: link::Classes/Pchain::.
59 Some parameters, like duration, cannot be used in the form of an array in the link::Classes/Pbind::. For full parallel expansion see link::Classes/PlazyEnvirN::.