linux: shared memory interface - link with librt
[supercollider.git] / HelpSource / Classes / PV_LocalMax.schelp
blobebd2e5ab9238e254b8e3eb02ce505cf6037e2b3f
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 nearest neighbors.
11 classmethods::
13 method::new
15 argument::buffer
17 FFT buffer.
20 argument::threshold
22 Magnitude threshold.
25 Examples::
27 code::
28 s.boot;
29 b = Buffer.read(s, Help.dir +/+ "sounds/a11wlk01.wav");
33 SynthDef("help-localMax", { arg out=0;
34         var in, chain;
35         in = Mix.arFill(3, { LFSaw.ar(exprand(100, 500), 0, 0.1); });
36         chain = FFT(LocalBuf(2048), in);
37         chain = PV_LocalMax(chain, MouseX.kr(0, 50));
38         Out.ar(out, 0.5 * IFFT(chain).dup);
39 }).play(s);
43 SynthDef("help-localMax2", { arg out=0, soundBufnum=2;
44         var in, chain;
45         in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);
46         chain = FFT(LocalBuf(2048), in);
47         chain = PV_LocalMax(chain, MouseX.kr(0, 100));
48         Out.ar(out, 0.1 * IFFT(chain).dup);
49 }).play(s, [\soundBufnum, b]);