oneShot: free the responder before running user func (avoid error)
[supercollider.git] / HelpSource / Classes / PV_Min.schelp
blobf6e669cff3fd2d495eb29624be35f45b1fed5193
1 class:: PV_Min
2 summary:: Minimum magnitude.
3 related:: Classes/FFT, Classes/IFFT, Classes/PV_Add, Classes/PV_CopyPhase, Classes/PV_MagMul, Classes/PV_Max, Classes/PV_Mul
4 categories:: UGens>FFT
6 Description::
8 Output copies bins with the minimum 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;
27 b = Buffer.alloc(s,2048,1);
28 c = Buffer.alloc(s,2048,1);
29 d = Buffer.read(s,"sounds/a11wlk01.wav");
33 var exBuf;
34         CocoaDialog.getPaths({ arg paths; //get a second soundfile;
35         paths.do({ arg p; exBuf = Buffer.read(s, p);
37 SynthDef("help-min", { arg out=0, bufnumA=0, bufnumB=1, soundBufnum1=2, soundBufnum2 = 3;
38         var inA, chainA, inB, chainB, chain ;
39         inA = PlayBuf.ar(1, soundBufnum1, BufRateScale.kr(soundBufnum1), loop: 1);
40         inB =  PlayBuf.ar(1, soundBufnum2, BufRateScale.kr(soundBufnum2), loop: 1);
41         chainA = FFT(bufnumA, inA);
42         chainB = FFT(bufnumB, inB);
43         chain = PV_Min(chainA, chainB); 
44         Out.ar(out,  0.5 * IFFT(chain).dup);
45 }).play(s,[\out, 0, \bufnumA, b.bufnum, \bufnumB, c.bufnum, \soundBufnum1, d.bufnum, \soundBufnum2, exBuf.bufnum]);
46         })
47 },{
48         "cancelled".postln;
49 });