1 <!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
4 <meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8">
5 <meta http-equiv=
"Content-Style-Type" content=
"text/css">
7 <meta name=
"Generator" content=
"Cocoa HTML Writer">
8 <meta name=
"CocoaVersion" content=
"949.43">
9 <style type=
"text/css">
10 p
.p1
{margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica
}
11 p
.p2
{margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica
; min-height: 14.0px}
12 p
.p3
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; min-height: 12.0px}
13 p
.p4
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #982316}
14 p
.p5
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
}
15 span
.s1
{font: 18.0px Helvetica
}
16 span
.s2
{font: 7.0px Helvetica
}
17 span
.s3
{color: #0025b2}
18 span
.Apple-tab-span
{white-space:pre
}
22 <p class=
"p1"><span class=
"s1"><b>CuspL
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></b></span><b>cusp map chaotic generator
</b></p>
23 <p class=
"p2"><br></p>
24 <p class=
"p1"><b>CuspL.ar(freq, a, b, xi, mul, add)
</b></p>
25 <p class=
"p2"><br></p>
26 <p class=
"p1"><span class=
"Apple-tab-span"> </span><b>freq
</b> - iteration frequency in Hertz
</p>
27 <p class=
"p1"><span class=
"Apple-tab-span"> </span><b>a, b
</b> - equation variables
</p>
28 <p class=
"p1"><span class=
"Apple-tab-span"> </span><b>xi
</b> - initial value of x
</p>
29 <p class=
"p3"><br></p>
30 <p class=
"p1">A linear-interpolating sound generator based on the difference equation:
</p>
31 <p class=
"p2"><span class=
"Apple-tab-span"> </span></p>
32 <p class=
"p1"><span class=
"Apple-tab-span"> </span>x
<span class=
"s2"><sub>n+
1</sub></span> = a - b*sqrt(|x
<span class=
"s2"><sub>n
</sub></span>|)
</p>
33 <p class=
"p3"><br></p>
34 <p class=
"p3"><br></p>
35 <p class=
"p4">// vary frequency
</p>
36 <p class=
"p5">{
<span class=
"s3">CuspL
</span>.ar(
<span class=
"s3">MouseX
</span>.kr(
20,
<span class=
"s3">SampleRate
</span>.ir),
1.0,
1.99) *
0.3 }.play(s);
</p>
37 <p class=
"p3"><br></p>
38 <p class=
"p4">// mouse-controlled params
</p>
39 <p class=
"p5">{
<span class=
"s3">CuspL
</span>.ar(
<span class=
"s3">SampleRate
</span>.ir/
4,
<span class=
"s3">MouseX
</span>.kr(
0.9,
1.1,
1),
<span class=
"s3">MouseY
</span>.kr(
1.8,
2,
1)) *
0.3 }.play(s);
</p>
40 <p class=
"p3"><br></p>
41 <p class=
"p4">// as a frequency control
</p>
42 <p class=
"p5">{
<span class=
"s3">SinOsc
</span>.ar(
<span class=
"s3">CuspL
</span>.ar(
<span class=
"s3">40</span>,
<span class=
"s3">MouseX
</span>.kr(
0.9,
1.1,
1),
<span class=
"s3">MouseY
</span>.kr(
1.8,
2,
1))*
800+
900)*
0.4 }.play(s);
</p>