Merge pull request #506 from andrewcsmith/patch-2
[supercollider.git] / HelpSource / Classes / Pgeom.schelp
bloba39515bad5c7c0f44354cd1a7a13c79b295fcf4c
1 class:: Pgeom
2 summary:: geometric series pattern
3 related:: Classes/Pseries
4 categories:: Streams-Patterns-Events>Patterns>List
6 description::
8 Returns a stream that behaves like a geometric series.
10 ClassMethods::
12 method::new
14 argument::start
15 start value.
17 argument::grow
18 multiplication factor.
20 argument::length
21 number of values produced.
23 Examples::
25 code::
27 var a;
28 a = Pgeom(1.0, 1.1, inf);
29 a.asStream.nextN(100).plot;
33 // sound example
35 SynthDef(\help_sinegrain,
36         { arg out=0, freq=440, sustain=0.05, amp=0.1;
37                 var env;
38                 env = EnvGen.kr(Env.perc(0.01, sustain, 0.2, amp), doneAction:2);
39                 Out.ar(out, SinOsc.ar(freq, 0, env))
40         }).add;
45 var a;
46 a = Pgeom(300, 1.03, 70).asStream;
48         a.do { |val|
49                 Synth(\help_sinegrain, [\freq, val]);
50                 0.02.wait;
51         }
52 }.fork;
56 Pbind(
57         \dur, 0.01,
58         \instrument, \help_sinegrain,
59         \freq, Pgeom(800, Pbrown(0.99, 1.01, 0.01, inf), inf)
60 ).play;