SuperCollider CLASSES (extension)

PV_CommonMag
ExtensionExtension

returns common magnitudes
Inherits from: UGen : AbstractFunction : Object
Subclasses: PV_CommonMul

Description

Returns magnitudes common to bufferA & bufferB within a tolerance level.

Class Methods

*new (bufferA, bufferB, tolerance: 0, remove: 0)

Arguments:

bufferA

fft buffer A.

bufferB

fft buffer B.

tolerance

magnitudes within which test will pass

remove

scale uncommon magnitudes

Inherited class methods

Instance Methods

Inherited instance methods

Examples

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

(
SynthDef("help-commonMag", { arg out=0, bufnumA=0, bufnumB=1, soundBufnum=2;
    var inA, inB, chainA, chainB, chain;
    inA = HPF.ar(Mix(LFSaw.ar([100, 150], 0, 0.2)), 1200);
    inB = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);
    chainA = FFT(bufnumA, inA);
    chainB = FFT(bufnumB, inB);
    chain = PV_CommonMag(chainA, chainB, MouseX.kr(0, 50), MouseY.kr);
    Out.ar(out,  IFFT(chain).dup);
}).play(s,[\out, 0, \bufnumA, b.bufnum, \bufnumB, c.bufnum, \soundBufnum, d.bufnum]);
)