oneShot: free the responder before running user func (avoid error)
[supercollider.git] / HelpSource / Classes / PV_LocalMax.schelp
blobfe9cdf8f032822c277f860295381276dd539be5a
1 class:: PV_LocalMax
2 summary:: Pass bins which are a local maximum.
3 related:: Classes/FFT, Classes/IFFT, Classes/PV_MagAbove, Classes/PV_MagBelow, Classes/PV_MagClip
4 categories:: UGens>FFT
6 Description::
8 Passes only bins whose magnitude is above a threshold and above their
9 nearest neighbors.
12 classmethods::
14 method::new
16 argument::buffer
18 FFT buffer.
21 argument::threshold
23 Magnitude threshold.
26 Examples::
28 code::
30 s.boot;
33 b = Buffer.alloc(s,2048,1);
34 c = Buffer.read(s,"sounds/a11wlk01.wav");
38 SynthDef("help-localMax", { arg out=0, bufnum=0;
39         var in, chain;
40         in = Mix.arFill(3, { LFSaw.ar(exprand(100, 500), 0, 0.1); });
41         chain = FFT(bufnum, in);
42         chain = PV_LocalMax(chain, MouseX.kr(0, 50)); 
43         Out.ar(out, 0.5 * IFFT(chain).dup);
44 }).play(s,[\out, 0, \bufnum, b.bufnum]);
48 SynthDef("help-localMax2", { arg out=0, bufnum=0, soundBufnum=2;
49         var in, chain;
50         in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);
51         chain = FFT(bufnum, in);
52         chain = PV_LocalMax(chain, MouseX.kr(0, 100)); 
53         Out.ar(out, 0.5 * IFFT(chain).dup);
54 }).play(s,[\out, 0, \bufnum, b.bufnum, \soundBufnum, c.bufnum]);