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.35">
9 <style type=
"text/css">
10 p
.p1
{margin: 0.0px 0.0px 0.0px 0.0px; font: 14.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: 12.0px Helvetica
}
13 p
.p4
{margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica
; color: #0021e7}
14 p
.p5
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
}
15 p
.p6
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; min-height: 12.0px}
16 p
.p7
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #606060}
17 p
.p8
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #000000}
18 span
.s1
{font: 18.0px Helvetica
}
19 span
.s2
{color: #000000}
20 span
.s3
{text-decoration: underline
}
21 span
.s4
{color: #001bb9}
22 span
.s5
{color: #0000bf}
23 span
.s6
{color: #606060}
24 span
.s7
{color: #007300}
25 span
.Apple-tab-span
{white-space:pre
}
29 <p class=
"p1"><span class=
"s1"><b>PV_Add
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></b></span><b>complex addition
</b></p>
30 <p class=
"p2"><br></p>
31 <p class=
"p3"><b>PV_Add(bufferA,
<span class=
"Apple-converted-space"> </span>bufferB)
</b></p>
32 <p class=
"p2"><br></p>
33 <p class=
"p3">Complex Addition: RealA + RealB, ImagA + ImagB
</p>
34 <p class=
"p3"><b>bufferA
</b> - fft buffer A.
</p>
35 <p class=
"p3"><b>bufferB
</b> - fft buffer B.
</p>
36 <p class=
"p4"><span class=
"s2">See also
<a href=
"FFT Overview.html"><span class=
"s3">FFT Overview
</span></a>.
</span></p>
37 <p class=
"p2"><br></p>
38 <p class=
"p5">s.boot;
</p>
39 <p class=
"p6"><br></p>
40 <p class=
"p7"><span class=
"s2">d =
</span><span class=
"s4">Buffer
</span><span class=
"s2">.read(s,
</span>"sounds/a11wlk01.wav"<span class=
"s2">);
</span></p>
41 <p class=
"p6"><br></p>
42 <p class=
"p6"><br></p>
44 <p class=
"p8"><span class=
"s5">SynthDef
</span>(
<span class=
"s6">"help-add"</span>, {
<span class=
"s5">arg
</span> out=
0, soundBufnum;
</p>
45 <p class=
"p8"><span class=
"Apple-tab-span"> </span><span class=
"s5">var
</span> inA, chainA, inB, chainB, chain ;
</p>
46 <p class=
"p8"><span class=
"Apple-tab-span"> </span>inA =
<span class=
"s5">PlayBuf
</span>.ar(
1,
<span class=
"s2">soundBufnum
</span>,
<span class=
"s5">BufRateScale
</span>.kr(soundBufnum), loop:
1);
</p>
47 <p class=
"p8"><span class=
"Apple-tab-span"> </span>inB =
<span class=
"Apple-converted-space"> </span><span class=
"s5">PlayBuf
</span>.ar(
1,
<span class=
"s2">soundBufnum
</span>,
<span class=
"s5">BufRateScale
</span>.kr(soundBufnum) *
0.5, loop:
1);
</p>
48 <p class=
"p8"><span class=
"Apple-tab-span"> </span>chainA =
<span class=
"s5">FFT
</span>(
<span class=
"s5">LocalBuf
</span>(
2048), inA);
</p>
49 <p class=
"p8"><span class=
"Apple-tab-span"> </span>chainB =
<span class=
"s5">FFT
</span>(
<span class=
"s5">LocalBuf
</span>(
2048), inB);
</p>
50 <p class=
"p8"><span class=
"Apple-tab-span"> </span>chain =
<span class=
"s5">PV_Add
</span>(chainA, chainB);
<span class=
"Apple-converted-space"> </span></p>
51 <p class=
"p8"><span class=
"Apple-tab-span"> </span><span class=
"s5">Out
</span>.ar(out,
<span class=
"Apple-converted-space"> </span>0.1 *
<span class=
"s5">IFFT
</span>(chain).dup);
</p>
52 <p class=
"p8">}).play(s, [
<span class=
"s7">\soundBufnum
</span>, d]);
</p>
54 <p class=
"p6"><br></p>
55 <p class=
"p5">d.free;
</p>