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: 18.0px Helvetica
; min-height: 22.0px}
12 p
.p3
{margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica
; min-height: 14.0px}
13 p
.p4
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; min-height: 12.0px}
14 p
.p5
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #842d1c}
15 p
.p6
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
}
16 p
.p7
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #842d1c; min-height: 12.0px}
17 span
.s1
{font: 18.0px Helvetica
}
18 span
.s2
{color: #002bf0}
19 span
.s3
{color: #0029ac}
20 span
.s4
{color: #000000}
21 span
.Apple-tab-span
{white-space:pre
}
25 <p class=
"p1"><span class=
"s1"><b>BufDelayN
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></b></span><b>buffer based simple delay line with no interpolation
</b></p>
26 <p class=
"p2"><br></p>
27 <p class=
"p1"><b>BufDelayN.ar(buf, in, delaytime, mul, add)
</b></p>
28 <p class=
"p1"><b>BufDelayN.kr(buf, in, delaytime, mul, add)
</b></p>
29 <p class=
"p3"><br></p>
30 <p class=
"p1">Simple delay line with no interpolation which uses a buffer for its internal memory. See also
<a href=
"BufDelayL.html"><span class=
"s2">BufDelayL
</span></a> which uses linear interpolation, and
<a href=
"BufDelayC.html"><span class=
"s2">BufDelayC
</span></a> which uses cubic interpolation. Cubic interpolation is more computationally expensive than linear, but more accurate.
</p>
31 <p class=
"p3"><br></p>
32 <p class=
"p1">See also
<a href=
"DelayN.html"><span class=
"s2">DelayN
</span></a>.
</p>
33 <p class=
"p3"><br></p>
34 <p class=
"p1"><b>buf
</b> - buffer number.
</p>
35 <p class=
"p1"><b>in
</b> - the input signal.
</p>
36 <p class=
"p1"><b>delaytime
</b> - delay time in seconds.
</p>
37 <p class=
"p3"><b>Warning:
</b> For reasons of efficiency, the effective
38 buffer size is limited to the previous power of two. So, if
44100
39 samples are allocated, the maximum delay would be
32768 samples.
</p>
40 <p class=
"p3"><br></p>
41 <p class=
"p4"><br></p>
42 <p class=
"p5">// allocate buffer
</p>
43 <p class=
"p6">b =
<span class=
"s3">Buffer
</span>.alloc(s,
44100,
1);
</p>
44 <p class=
"p7"><br></p>
46 <p class=
"p5">// Dust randomly triggers Decay to create an exponential
<span class=
"Apple-converted-space"> </span></p>
47 <p class=
"p5">// decay envelope for the WhiteNoise input source
</p>
49 <p class=
"p6">z =
<span class=
"s3">Decay
</span>.ar(
<span class=
"s3">Dust
</span>.ar(
1,
0.5),
0.3,
<span class=
"s3">WhiteNoise
</span>.ar);
</p>
50 <p class=
"p5"><span class=
"s3">BufDelayN
</span><span class=
"s4">.ar(b, z,
0.2,
1, z);
</span>// input is mixed with delay via the add input
</p>
51 <p class=
"p6">}.play
</p>
53 <p class=
"p4"><br></p>