linux: shared memory interface - link with librt
[supercollider.git] / HelpSource / Classes / PV_MagSmear.schelp
blobcc7557eef5172f012c06d0604674ab88ebbf2f2a
1 class:: PV_MagSmear
2 summary:: Average magnitudes across bins.
3 categories:: UGens>FFT
5 Description::
7 Average a bin's magnitude with its neighbors.
10 classmethods::
12 method::new
14 argument::buffer
16 FFT buffer.
19 argument::bins
21 Number of bins to average on each side of bin. As this number
22 rises, so will CPU usage.
25 Examples::
27 code::
29 s.boot;
32 b = Buffer.alloc(s,2048,1);
33 c = Buffer.read(s, Help.dir +/+ "sounds/a11wlk01.wav");
37 SynthDef("help-magSmear", { arg out=0, bufnum=0;
38         var in, chain;
39         in = LFSaw.ar(500, 0, Decay2.ar(Impulse.ar(2,0,0.2), 0.01, 2));
40         chain = FFT(bufnum, in);
41         chain = PV_MagSmear(chain, MouseX.kr(0, 100));
42         Out.ar(out, 0.5 * IFFT(chain).dup);
43 }).play(s,[\out, 0, \bufnum, b.bufnum]);
47 SynthDef("help-magSmear2", { arg out=0, bufnum=0, soundBufnum=2;
48         var in, chain;
49         in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);
50         chain = FFT(bufnum, in);
51         chain = PV_MagSmear(chain, MouseX.kr(0, 100));
52         Out.ar(out, 0.5 * IFFT(chain).dup);
53 }).play(s,[\out, 0, \bufnum, b.bufnum, \soundBufnum, c.bufnum]);