sclang: ServerShmInterface - try to avoid multiple destructor calls
[supercollider.git] / HelpSource / Classes / Pser.schelp
blobb832a9ab34dcf6307041358ec37485fee7147e76
1 class:: Pser
2 summary:: sequentially embed values in a list
3 related:: Classes/Pseq
4 categories:: Streams-Patterns-Events>Patterns>List
6 description::
8 is like link::Classes/Pseq::, however the repeats variable gives strong::the number of items:: returned instead of the number of complete cycles.
10 Examples::
12 code::
14 var a, b;
15 a = Pser([1, 2, 3], 5); // return 5 items
16 b = a.asStream;
17 6.do({ b.next.postln; });
20 //Pser used as a sequence of pitches:
23 SynthDef(\help_sinegrain,
24         { arg out=0, freq=440, sustain=0.05;
25                 var env;
26                 env = EnvGen.kr(Env.perc(0.01, sustain, 0.2), doneAction:2);
27                 Out.ar(out, SinOsc.ar(freq, 0, env))
28         }).add;
32 a = Pser([Pser(#[60, 61, 63, 65, 72], 3)], inf).asStream;
33 Routine({
34         loop({
35                 Synth(\help_sinegrain, [\freq, a.next.midicps]);
36                 0.2.wait;
37         })
38 }).play;