sclang: ServerShmInterface - try to avoid multiple destructor calls
[supercollider.git] / HelpSource / Classes / PV_MagSquared.schelp
blob2ae86b94cd2d149ba85c3de2f300d03b555cea72
1 class:: PV_MagSquared
2 summary:: Square magnitudes.
3 related:: Classes/FFT, Classes/IFFT
4 categories:: UGens>FFT
6 Description::
8 Squares the magnitudes and renormalizes to previous peak. This makes weak
9 bins weaker.
12 classmethods::
14 method::new
16 argument::buffer
18 FFT buffer.
21 Examples::
23 code::
25 s.boot;
28 b = Buffer.alloc(s,2048,1);
29 c = Buffer.read(s, Help.dir +/+ "sounds/a11wlk01.wav");
33 SynthDef("help-magSquared", {  arg out=0, bufnum=0, soundBufnum=2;
34         var in, chain;
35         in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);
36         chain = FFT(bufnum, in);
37         chain = PV_MagSquared(chain);
38         Out.ar(out, 0.003 * IFFT(chain).dup);
39 }).play(s,[\out, 0, \bufnum, b.bufnum, \soundBufnum, c.bufnum]);