linux: shared memory interface - link with librt
[supercollider.git] / HelpSource / Classes / PV_MagMul.schelp
blobef2dcfc517baa4da0967f73f35373cf9910c5d4f
1 class:: PV_MagMul
2 summary:: Multiply magnitudes.
3 related:: Classes/FFT, Classes/IFFT, Classes/PV_Add, Classes/PV_CopyPhase, Classes/PV_Max, Classes/PV_Min, Classes/PV_Mul
4 categories:: UGens>FFT
6 Description::
8 Multiplies magnitudes of two inputs and keeps the phases of the first input.
11 classmethods::
13 method::new
15 argument::bufferA
16 FFT buffer A.
18 argument::bufferB
19 FFT buffer B.
21 Examples::
23 code::
25 s.boot;
26 b = Buffer.read(s, Help.dir +/+ "sounds/a11wlk01.wav");
29 SynthDef("help-magMul", { arg out=0;
30         var inA, chainA, inB, chainB, chain;
31         inA = WhiteNoise.ar(0.2);
32         inB = LFSaw.ar(100, 0, 0.2);
33         chainA = FFT(LocalBuf(2048), inA);
34         chainB = FFT(LocalBuf(2048), inB);
35         chain = PV_MagMul(chainA, chainB);
36         Out.ar(out, 0.1 * IFFT(chain).dup);
37 }).play(s);
41 SynthDef("help-magMul2", { arg out=0, soundBufnum=2;
42         var inA, chainA, inB, chainB, chain;
43         inA = LFSaw.ar([100, 150], 0, 0.2);
44         inB = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);
45         chainA = FFT(LocalBuf(2048), inA);
46         chainB = FFT(LocalBuf(2048), inB);
47         chain = PV_MagMul(chainA, chainB);
48         Out.ar(out,  0.03 * IFFT(chain));
49 }).play(s, [\soundBufnum, b.bufnum]);
52 b.free