2 summary:: embed values randomly chosen from a list
3 related:: Classes/Pxrand, Classes/Pwrand
4 categories:: Streams-Patterns-Events>Patterns>List
8 Embed one item from the list at random for each repeat.
15 a = Prand([1, 2, 3, 4, 5], 6); // return 6 items
17 7.do({ b.next.postln; });
20 // return also a subpattern:
23 a = Prand([1, Pseq([10, 20, 30]), 2, 3, 4, 5], 6); // return 6 items
25 7.do({ b.next.postln; });
28 //Prand used as a sequence of pitches:
31 SynthDef(\help_sinegrain,
32 { arg out=0, freq=440, sustain=0.05;
34 env = EnvGen.kr(Env.perc(0.01, sustain, 0.2), doneAction:2);
35 Out.ar(out, SinOsc.ar(freq, 0, env))
40 a = Prand(#[60, 61, 63, 65, 72], inf).asStream;
43 Synth(\help_sinegrain, [\freq, a.next.midicps]);