2 summary:: buffers a streamed value
3 related:: Classes/Routine, Classes/FuncStream, Classes/EventStreamPlayer
4 categories:: Streams-Patterns-Events
12 a pattern or stream to be buffered.
15 if true it will call the next stream value for each time next is called. if false it returns the last value.
20 a = Pseq([1, 2, 3], inf);
23 6.do({ b.next.postln });
25 6.do({ b.next.postln });
29 a = Pseq([1, 2, 3], inf);
30 b = StreamClutch(a, { 0.5.coin });
31 12.do({ b.next.postln });
38 var clutch, pat, decicion;
39 decicion = Pseq([Pn(true,10), Prand([true, false], 10)], inf).asStream;
40 pat = Pbind(\freq, Pseq([200, [300, 302], 400, 450], inf), \dur, 0.3);
41 clutch = StreamClutch(pat, decicion);
42 clutch.asEventStreamPlayer.play;
47 // independant stepping
49 var clutch, pat, decicion;
50 pat = Pbind(\freq, Pseq([200, [300, 302], 400, 450], inf), \dur, 0.3);
51 b = StreamClutch(pat);
53 b.asEventStreamPlayer.play;