2 Non-linear Dynamic Sound Generators
6 This is a set of iterative functions and differential equations that
7 are known to exhibit chaotic behavior. Internal calculations are
8 done with 64-bit words to ensure greater accuracy.
10 The name of the function is followed by one of N, L, or C. These
11 represent the interpolation method used between function iterations.
21 // General Quadratic Map
23 const <equation="x1 = a*x0^2 + b*x0 + c";
24 *ar { arg freq=22050, a=1, b= -1, c= -0.75, xi=0, mul=1, add=0;
25 ^this.multiNew('audio', freq, a, b, c, xi).madd(mul, add)
33 const <equation="x1 = a - b*sqrt(|x0|)";
34 *ar { arg freq=22050, a=1, b=1.9, xi=0, mul=1, add=0;
35 ^this.multiNew('audio', freq, a, b, xi).madd(mul, add)
42 const <equation="x1 = 1 - y0 + |x0|\ny1 = x0";
43 *ar { arg freq=22050, xi=1.2, yi=2.1, mul=1, add=0;
44 ^this.multiNew('audio', freq, xi, yi).madd(mul, add)
51 const <equation="x2 = 1 - a*(x1^2) + b*x0";
52 *ar { arg freq=22050, a=1.4, b=0.3, x0=0, x1=0, mul=1.0, add=0.0;
53 ^this.multiNew('audio', freq, a, b, x0, x1).madd(mul, add)
60 LatoocarfianN : ChaosGen {
61 const <equation="x1 = sin(b*y0) + c*sin(b*x0)\ny1 = sin(a*x0) + d*sin(a*y0)";
62 *ar { arg freq=22050, a=1, b=3, c=0.5, d=0.5, xi=0.5, yi=0.5, mul=1.0, add=0.0;
63 ^this.multiNew('audio', freq, a, b, c, d, xi, yi).madd(mul, add)
66 LatoocarfianL : LatoocarfianN {}
67 LatoocarfianC : LatoocarfianN {}
69 // Linear Congruential
71 const <equation="x1 = ((a * x0) + c) % m";
72 *ar { arg freq=22050, a=1.1, c=0.13, m=1.0, xi=0, mul=1.0, add=0.0;
73 ^this.multiNew('audio', freq, a, c, m, xi).madd(mul, add)
76 LinCongL : LinCongN {}
77 LinCongC : LinCongN {}
80 StandardN : ChaosGen {
81 const <equation="x1 = (x0 + y1) % 2pi\ny1 = (y0 + k*sin(x0)) % 2pi";
82 *ar { arg freq=22050, k=1.0, xi=0.5, yi=0, mul=1.0, add=0.0;
83 ^this.multiNew('audio', freq, k, xi, yi).madd(mul, add)
86 StandardL : StandardN {}
88 // Feedback Sine with Linear Congruential Phase Indexing
90 const <equation="x1 = sin(im*y0 + fb*x0)\ny1 = (a*y0 + c) % 2pi";
91 *ar { arg freq=22050, im=1, fb=0.1, a=1.1, c=0.5, xi=0.1, yi=0.1, mul=1, add=0;
92 ^this.multiNew('audio',freq,im,fb,a,c,xi,yi).madd(mul, add)
99 // 'h' is integration time-step
103 const <equation="x' = s*(y-x)\ny' = x*(r-z)-y\nz' = x*y - b*z";
104 *ar { arg freq=22050, s=10, r=28, b=2.667, h=0.05, xi=0.1, yi=0, zi=0, mul=1.0, add=0.0;
105 ^this.multiNew('audio', freq, s, r, b, h, xi, yi, zi).madd(mul, add)