QcPenPrinter: no need to allocate QPrintDialog on heap
[supercollider.git] / HelpSource / Classes / Pstutter.schelp
blob216fea13a26468358d2d85f508ca14c0cb3c59ce
1 class:: Pstutter
2 summary:: repeat input stream values
3 related:: Classes/Pn
4 categories:: Streams-Patterns-Events>Patterns>Repetition
6 description::
8 repeat each element n times.
10 ClassMethods::
12 method::new
14 argument::n
15 may be a pattern, so the number of times can vary each iteration.
17 Examples::
19 code::
21 var a, b;
22 a = Pstutter(2, Pseq([1, 2, 3],inf));
23 x = a.asStream;
24 13.do({ x.next.postln; });
28 //Pstutter used as a sequence of pitches
31 SynthDef(\help_sinegrain,
32         { arg out=0, freq=440, sustain=0.05;
33                 var env;
34                 env = EnvGen.kr(Env.perc(0.01, sustain, 0.2), doneAction:2);
35                 Out.ar(out, SinOsc.ar(freq, 0, env))
36         }).add;
41 c = Pstutter(3, Prand([1, 2, 3],inf)*4+65);
42 x = c.asStream;
43 Routine({
44         loop({
45                 Synth(\help_sinegrain, [\freq, x.next.midicps]);
46                 0.12.wait;
47         })
48 }).play;