Classes | UGens > FFT

PV_MagSmear : PV_ChainUGen : WidthFirstUGen : UGen : AbstractFunction : Object

Average magnitudes across bins.
Source: FFT.sc

Description

Average a bin's magnitude with its neighbors.

Class Methods

PV_MagSmear.new(buffer, bins: 0)

Arguments:

buffer

FFT buffer.

bins

Number of bins to average on each side of bin. As this number rises, so will CPU usage.

Inherited class methods

Instance Methods

Inherited instance methods

Examples

s.boot;

(
b = Buffer.alloc(s,2048,1);
c = Buffer.read(s, Platform.resourceDir +/+ "sounds/a11wlk01.wav");
)

(
SynthDef("help-magSmear", { arg out=0, bufnum=0;
    var in, chain;
    in = LFSaw.ar(500, 0, Decay2.ar(Impulse.ar(2,0,0.2), 0.01, 2));
    chain = FFT(bufnum, in);
    chain = PV_MagSmear(chain, MouseX.kr(0, 100));
    Out.ar(out, 0.5 * IFFT(chain).dup);
}).play(s,[\out, 0, \bufnum, b.bufnum]);
)

(
SynthDef("help-magSmear2", { arg out=0, bufnum=0, soundBufnum=2;
    var in, chain;
    in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);
    chain = FFT(bufnum, in);
    chain = PV_MagSmear(chain, MouseX.kr(0, 100));
    Out.ar(out, 0.5 * IFFT(chain).dup);
}).play(s,[\out, 0, \bufnum, b.bufnum, \soundBufnum, c.bufnum]);
)