linux: shared memory interface - link with librt
[supercollider.git] / HelpSource / Classes / PV_Max.schelp
blob84671c0ddc084a4cad02761ad22597f2ee326760
1 class:: PV_Max
2 summary:: Maximum magnitude.
3 related:: Classes/FFT, Classes/IFFT, Classes/PV_Add, Classes/PV_CopyPhase, Classes/PV_MagMul, Classes/PV_Min, Classes/PV_Mul
4 categories:: UGens>FFT
6 Description::
8 Output copies bins with the maximum magnitude of the two inputs.
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 var exBuf;
30 Dialog.getPaths({ arg paths; //get a second soundfile;
31         paths.do({ arg p; exBuf = Buffer.read(s, p);
32                 SynthDef("help-max", { arg out=0, soundBufnum1=2, soundBufnum2 = 3;
33                         var inA, chainA, inB, chainB, chain ;
34                         inA = PlayBuf.ar(1, soundBufnum1, BufRateScale.kr(soundBufnum1), loop: 1);
35                         inB =  PlayBuf.ar(1, soundBufnum2, BufRateScale.kr(soundBufnum2), loop: 1);
36                         chainA = FFT(LocalBuf(2048), inA);
37                         chainB = FFT(LocalBuf(2048), inB);
38                         chain = PV_Max(chainA, chainB);
39                         Out.ar(out,  0.1 * IFFT(chain).dup);
40                 }).play(s, [\soundBufnum1, b.bufnum, \soundBufnum2, exBuf.bufnum]);
41         })
42 },{
43         "cancelled".postln;
44 });
47 b.free;