SuperCollider CLASSES (extension)

SVF
ExtensionExtension

12db/Oct State Variable Filter
Inherits from: UGen : AbstractFunction : Object

Description

Total, 100% Plastic...

Class Methods

*ar (signal, cutoff: 2200, res: 0.1, lowpass: 1, bandpass: 0, highpass: 0, notch: 0, peak: 0, mul: 1, add: 0)

*kr (signal, cutoff: 2200, res: 0.1, lowpass: 1, bandpass: 0, highpass: 0, notch: 0, peak: 0, mul: 1, add: 0)

Arguments:

signal

audio in

cutoff

cutoff frequency

res

resonance. 0.0 - 1.0

lowpass

lowpass filter output level. 0.0 - 1.0

bandpass

bandpass filter output level. 0.0 - 1.0

highpass

high filter output level. 0.0 - 1.0

notch

notchfilter output level. 0.0 - 1.0

peak

peak filter output level. 0.0 - 1.0

Inherited class methods

Instance Methods

Inherited instance methods

Examples

s.boot;
(
z = SynthDef(\svf_test, { arg low=0.1, band=0.0, high=0.0, notch=0.0, peak=0.0;
    var sig;

    sig = SVF.ar(
        LFSaw.ar(LFSaw.kr(2).range(110,35)),    // signal
        MouseX.kr(20,20000,'exponential'),    // cutoff
        MouseY.kr(1.0,0,'linear'),        // q
        low, band, high, notch, peak);        // levels
    Out.ar(0, sig ! 2);
}).play(addAction: \addToTail);
)

z.set(\low, 0.1);
z.set(\band, 0.0);
z.set(\high, 0.0);
z.set(\notch, 0.0);
z.set(\peak, 0.0);

// a small gui (example requires crucial lib)
(
k= [];
[\low, \band, \high, \notch, \peak].do({ arg j;
    k = k.add(KnobEditor.new(0.0, \amp).action_({ arg v; z.set(j, v.value) }) )
 });
)

(
Sheet({ arg lay;
    [\low, \band, \high, \notch, \peak].do({ arg j; CXLabel.new(lay, j, minWidth: 44) });
    lay.startRow;
    k.do(_.gui(lay));
}, "SVF")
)

z.free

(
Patch({ arg in, ffreq=1200.0, res=0.5, low=0.25, band=0.0, high=0.0, notch=0.0, peak=0.0;

    SVF.ar(
        LFSaw.ar(LFSaw.kr(2).range(110,55), 0.0, 0.1),
        ffreq, res, low, band, high, notch, peak);

}).gui
)

(
Patch({ arg low=0.25, band=0.0, high=0.0, notch=0.0, peak=0.0;
    var sig, freq;
    freq = MouseX.kr(20,12000,\exponential);
    sig = SVF.ar(
        LFSaw.ar([freq * 0.99, freq * 1.01], 0, 0.1) ! 2,
        SinOsc.kr(SinOsc.kr(0.1),1.5pi,1550,1800),
        MouseY.kr(1,0,\linear),
        low, band, high, notch, peak);
     (CombN.ar(sig, 0.4, [0.4,0.35],2) * 0.4) + (sig * 0.5);
}).gui
)