SuperCollider CLASSES (extension)

PV_MagGate
ExtensionExtension

reduces magnitudes above or below thresh
Inherits from: UGen : AbstractFunction : Object

Description

For positive values of thresh, acts something like a noise reduction. For negative values, highlights smaller sounds.

Class Methods

*new (buffer, thresh: 1, remove: 0)

Arguments:

buffer

fft buffer

thresh

if positive, scales magnitudes below thresh. if negative scales magnitudes above abs(thresh)

remove

amount to scale magnitudes.

Inherited class methods

Instance Methods

Inherited instance methods

Examples

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

(
SynthDef("help-magGate", { 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_MagGate(chain, MouseX.kr(0, 100), MouseY.kr(0, 1));
    Out.ar(out,  IFFT(chain).dup);
}).play(s,[\out, 0, \bufnum, b.bufnum, \soundBufnum, c.bufnum]);
)

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