scide: implement selectionLength for openDocument
[supercollider.git] / HelpSource / Classes / Pwrap.schelp
blobc30936c24a2a726de5c0d28d557c05bc55b74c7a
1 class:: Pwrap
2 summary:: constrain the range of output values by wrapping
3 related:: Classes/SimpleNumber
4 categories:: Streams-Patterns-Events>Patterns>Math
6 description::
7 Note: this is equivalent to pattern.wrap(lo, hi)
9 Examples::
11 code::
13 SynthDef(\help_sinegrain,
14         { arg out=0, freq=440, sustain=0.05;
15                 var env;
16                 env = EnvGen.kr(Env.perc(0.01, sustain, 0.2), doneAction:2);
17                 Out.ar(out, SinOsc.ar(freq, 0, env))
18         }).add;
22 a = Pn(
23         Pwrap(
24                 Pgeom(200,1.07,96),
25                 200,
26                 1000.0
27         ),
28         inf
30 x = a.asStream;
32 Routine({
33         loop({
34                 Synth(\help_sinegrain, [\freq, x.next.debug,\dur,0.3]);
35                 0.12.wait;
36         })
37 }).play;