2 summary:: combine a list of streams to a stream of lists
4 categories:: Streams-Patterns-Events>Patterns>List
8 At each iteration, Ptuple returns a tuple (array) combining the output of each of the patterns in the list. When any of the patterns returns a nil, Ptuple ends that 'repeat' and restarts all of the streams.
15 an link::Classes/Array:: of patterns.
18 an link::Classes/Integer:: or inf.
25 a = Pseq([1, 2, 3], inf);
26 b = Pseq([65, 76], inf);
27 c = Ptuple([a, a, b], inf);
29 8.do({ x.next.postln; });
35 a = Pseq([1, 2, 3], inf);
36 b = Pseq([65, 76], 3); // stops after 3 cycles
37 c = Ptuple([a, a, b], 4); // stops after 4 cycles
39 8.do({ x.next.postln; });
43 //Ptuple used as a sequence of pitches (chords)
46 SynthDef(\help_sinegrain,
47 { arg out=0, freq=440, sustain=0.05;
49 env = EnvGen.kr(Env.perc(0.01, sustain, 0.2), doneAction:2);
50 Out.ar(out, SinOsc.ar(freq, 0, env))
55 a = Pseq([73, 71, 69, 69, 65, 64], inf);
56 b = Pseq([0, 0, 0, 4, 0, 3, 2], inf) + a;
57 c = Ptuple([a, b], inf);
62 chord = x.next.postln.midicps;
63 (instrument: \help_sinegrain, freq: chord).play;