Merge pull request #506 from andrewcsmith/patch-2
[supercollider.git] / HelpSource / Classes / QuadN.schelp
blob4c87713c6c91128f6abad0a0a41995e244982b5d
1 class:: QuadN
2 summary:: General quadratic map chaotic generator
3 categories:: UGens>Generators>Chaotic
4 related:: Classes/QuadL, Classes/QuadC
6 description::
7 A non-interpolating sound generator based on the difference equation:
9 code::
10         x[n+1] = a * pow(x[n], 2) + b * x[n] + c
12 warning:: revise formulae conversion to c like code ::
14 classmethods::
15 method:: ar
16 argument:: freq
17 Iteration frequency in Hertz
18 argument:: a
19 Equation variable
20 argument:: b
21 Equation variable
22 argument:: c
23 Equation variable
24 argument:: xi
25 Initial value of x
26 argument:: mul
27 argument:: add
29 examples::
30 code::
31 // default params
32 { QuadN.ar(SampleRate.ir/4) * 0.2 }.play(s);
35 code::
36 // logistic map
37 // equation: x1 = -r*x0^2 + r*x0
39 { var r;
40         r = MouseX.kr(3.5441, 4);       // stable range
41         QuadN.ar(SampleRate.ir/4, r.neg, r, 0, 0.1) * 0.4;
42 }.play(s);
46 code::
47 // logistic map as frequency control
49 { var r;
50         r = MouseX.kr(3.5441, 4);       // stable range
51         SinOsc.ar(QuadN.ar(40, r.neg, r, 0, 0.1, 800, 900)) * 0.4;
52 }.play(s);