JSFX - CookDSP version 0.5 documentation



MOOG

24dB/oct resonant lowpass filter.

Description

Implementation of the Moog ladder filter based on the work of Antti Huovilainen, described in the paper "Non-Linear Digital Implementation of the Moog Ladder Filter" (Proceedings of DaFX04, University of Napoli). Adapted from Csound code for the moogladder opcode (Victor Lazzarini).
It must be used with a variable name as prefix (object oriented).

Initializer

moog(freq, res)

Initializes a fourth-order IIR resonant lowpass filter with cutoff frequency freq, in Hz, and amount of resonance res, between 0 (no resonance) and 1 (self-oscillation).

Methods

moog_set_freq(freq)

Sets a new cutoff frequency freq, in Hz.

moog_set_res(res)

Sets a new resonance factor, between 0 and 1.

moog_do(signal)

Processes one samples of an input signal signal and outputs the filtered sample.

Example

desc:24dB/oct Resonant Lowpass Filter

import cookdsp.jsfx-inc

slider1:3500<100,12000>Cutoff Frequency in Hz
slider2:0.5<0,1>Resonance

@init
// Initializes the filter
filt1.moog(slider1, slider2);
filt2.moog(slider1, slider2);

@slider
filt1.moog_set_freq(slider1);
filt2.moog_set_freq(slider1);
filt1.moog_set_res(slider2);
filt2.moog_set_res(slider2);

@sample
// Filters the input signal
spl0 = filt1.moog_do(spl0);
spl1 = filt2.moog_do(spl1);

Download example : cookdsp_moog

See the source file : filters.jsfx-inc

(c) Olivier BĂ©langer, 2020