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
; min-height: 12.0px}
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: #bf0000}
17 span
.s1
{font: 18.0px Helvetica
}
18 span
.s2
{color: #000000}
19 span
.s3
{text-decoration: underline
}
20 span
.s4
{color: #0000bf}
21 span
.s5
{color: #bf0000}
22 span
.s6
{color: #0029ac}
23 span
.s7
{color: #606060}
24 span
.Apple-tab-span
{white-space:pre
}
28 <p class=
"p1"><span class=
"s1"><b>PV_Mul
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></b></span><b>complex multiply
</b></p>
29 <p class=
"p2"><br></p>
30 <p class=
"p3"><b>PV_Mul(bufferA,
<span class=
"Apple-converted-space"> </span>bufferB)
</b></p>
31 <p class=
"p2"><br></p>
32 <p class=
"p3">Complex Multiplication: (RealA * RealB) - (ImagA * ImagB), (ImagA * RealB) + (RealA * ImagB)
</p>
33 <p class=
"p3"><b>bufferA
</b> - fft buffer A.
</p>
34 <p class=
"p3"><b>bufferB
</b> - fft buffer B.
</p>
35 <p class=
"p2"><br></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"><br></p>
39 <p class=
"p5"><br></p>
42 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"s4">var
</span> inA, chainA, inB, chainB, chain ;
</p>
43 <p class=
"p6"><span class=
"Apple-tab-span"> </span>inA =
<span class=
"s4">Saw
</span>.ar(
<span class=
"s4">LFNoise1
</span>.kr(
2).exprange(
10,
1000));
</p>
44 <p class=
"p6"><span class=
"Apple-tab-span"> </span>inB =
<span class=
"Apple-converted-space"> </span><span class=
"s4">Pulse
</span>.ar(
<span class=
"s4">LFNoise1
</span>.kr(
2).exprange(
10,
1000));
</p>
45 <p class=
"p6"><span class=
"Apple-tab-span"> </span>chainA =
<span class=
"s4">FFT
</span>(
<span class=
"s4">LocalBuf
</span>(
2048), inA);
</p>
46 <p class=
"p6"><span class=
"Apple-tab-span"> </span>chainB =
<span class=
"s4">FFT
</span>(
<span class=
"s4">LocalBuf
</span>(
2048), inB);
</p>
47 <p class=
"p6"><span class=
"Apple-tab-span"> </span>chain =
<span class=
"s4">PV_Mul
</span>(chainA, chainB);
<span class=
"Apple-converted-space"> </span></p>
48 <p class=
"p6"><span class=
"Apple-tab-span"> </span>0.03 *
<span class=
"s4">IFFT
</span>(chain).dup;
</p>
49 <p class=
"p6">}.play
</p>
51 <p class=
"p5"><br></p>
52 <p class=
"p5"><br></p>
53 <p class=
"p7">// stereo version:
</p>
54 <p class=
"p5"><br></p>
57 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"s4">var
</span> inA, chainA, inB, chainB, chain ;
</p>
58 <p class=
"p6"><span class=
"Apple-tab-span"> </span>inA =
<span class=
"s4">Saw
</span>.ar(
<span class=
"s4">LFNoise1
</span>.kr(
2).exprange(
10,
1000));
<span class=
"s5">// same saw through different pulses
</span></p>
59 <p class=
"p6"><span class=
"Apple-tab-span"> </span>inB =
<span class=
"Apple-converted-space"> </span><span class=
"s4">Pulse
</span>.ar(
<span class=
"s4">LFNoise1
</span>.kr(
2.dup).exprange(
10,
1000));
</p>
60 <p class=
"p6"><span class=
"Apple-tab-span"> </span>chainA =
<span class=
"s4">FFT
</span>(
<span class=
"s4">LocalBuf
</span>(
2048.dup), inA);
</p>
61 <p class=
"p6"><span class=
"Apple-tab-span"> </span>chainB =
<span class=
"s4">FFT
</span>(
<span class=
"s4">LocalBuf
</span>(
2048.dup), inB);
</p>
62 <p class=
"p6"><span class=
"Apple-tab-span"> </span>chain =
<span class=
"s4">PV_Mul
</span>(chainA, chainB);
<span class=
"Apple-converted-space"> </span></p>
63 <p class=
"p6"><span class=
"Apple-tab-span"> </span>0.03 *
<span class=
"s4">IFFT
</span>(chain);
</p>
64 <p class=
"p6">}.play
</p>
66 <p class=
"p5"><br></p>
67 <p class=
"p5"><br></p>
68 <p class=
"p5"><br></p>
70 <p class=
"p6"><span class=
"s6">SynthDef
</span>(
<span class=
"s7">"help-mul"</span>, {
<span class=
"s6">arg
</span> out=
0;
</p>
71 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"s6">var
</span> inA, chainA, inB, chainB, chain ;
</p>
72 <p class=
"p6"><span class=
"Apple-tab-span"> </span>inA =
<span class=
"s6">SinOsc
</span>.ar(
500,
0,
0.5);
</p>
73 <p class=
"p6"><span class=
"Apple-tab-span"> </span>inB =
<span class=
"Apple-converted-space"> </span><span class=
"s6">SinOsc
</span>.ar(
<span class=
"s6">Line
</span>.kr(
100,
400,
5),
0,
0.5);
</p>
74 <p class=
"p6"><span class=
"Apple-tab-span"> </span>chainA =
<span class=
"s6">FFT
</span>(
<span class=
"s4">LocalBuf
</span>(
2048), inA);
</p>
75 <p class=
"p6"><span class=
"Apple-tab-span"> </span>chainB =
<span class=
"s6">FFT
</span>(
<span class=
"s4">LocalBuf
</span>(
2048), inB);
</p>
76 <p class=
"p6"><span class=
"Apple-tab-span"> </span>chain =
<span class=
"s6">PV_Mul
</span>(chainA, chainB);
<span class=
"Apple-converted-space"> </span></p>
77 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"s6">Out
</span>.ar(out,
<span class=
"Apple-converted-space"> </span>0.5 *
<span class=
"s6">IFFT
</span>(chain).dup);
</p>
78 <p class=
"p6">}).play;
</p>
80 <p class=
"p5"><br></p>
82 <p class=
"p6"><span class=
"s6">SynthDef
</span>(
<span class=
"s7">"help-mul2"</span>, {
<span class=
"s6">arg
</span> out=
0;
</p>
83 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"s6">var
</span> inA, chainA, inB, chainB, chain ;
</p>
84 <p class=
"p6"><span class=
"Apple-tab-span"> </span>inA =
<span class=
"s6">SinOsc
</span>.ar(
500,
0,
0.5) *
<span class=
"s6">Line
</span>.kr;
</p>
85 <p class=
"p6"><span class=
"Apple-tab-span"> </span>inB =
<span class=
"s6">LFNoise1
</span>.ar(
20);
</p>
86 <p class=
"p6"><span class=
"Apple-tab-span"> </span>chainA =
<span class=
"s6">FFT
</span>(
<span class=
"s4">LocalBuf
</span>(
2048), inA);
</p>
87 <p class=
"p6"><span class=
"Apple-tab-span"> </span>chainB =
<span class=
"s6">FFT
</span>(
<span class=
"s4">LocalBuf
</span>(
2048), inB);
</p>
88 <p class=
"p6"><span class=
"Apple-tab-span"> </span>chain =
<span class=
"s6">PV_Mul
</span>(chainA, chainB);
<span class=
"Apple-converted-space"> </span></p>
89 <p class=
"p6"><span class=
"Apple-tab-span"> </span><span class=
"s6">Out
</span>.ar(out,
<span class=
"Apple-converted-space"> </span>0.5 *
<span class=
"s6">IFFT
</span>(chain).dup);
</p>
90 <p class=
"p6">}).play;
</p>
92 <p class=
"p5"><br></p>