24db/octave resonant lowpass filter.
in RTcmix/insts/jg
MOOGVCF(outsk, insk, dur, AMP, inputchan, PAN, BYPASS, FILTFREQTABLE, FILTRESONTABLE)
CAPITALIZED parameters are pfield-enabled for table or dynamic control (see the maketable or makeconnection scorefile commands). Parameters after the [bracket] are optional and default to 0 unless otherwise noted.
Param Field | Parameter | Units | Dynamic | Optional | Notes |
---|---|---|---|---|---|
p0 | output start time | seconds | no | no | |
p1 | input start time | seconds | no | no | |
p2 | input duration | seconds | no | no | |
p3 | amplitude multiplier | relative multiplier of input signal | yes | no | |
p4 | input channel | - | no | no | |
p5 | pan | 0-1 stereo; 0.5 is middle | yes | no | |
p6 | bypass filter | 0: bypass off, 1: bypass on | yes | no | usually use 0 |
p7 | filter cutoff frequency | Hz | yes | no | |
p8 | filter resonance | 0-1 | yes | no | 1 is more resonant. > 1.0 will self-oscillate |
Parameters labled as Dynamic can receive dynamic updates from a table or real-time control source.
Author: John Gibson, 22 May 2002; rev for v4, 7/24/04 This is based on the design by Stilson and Smith (CCRMA), as modified by Paul Kellett (described in the source code archives at musicdsp.org).
MOOGVCF duplicates the famous “Moog” lowpass filter.
One of the characteristics of this filter is a sharp resonant peak at the lowpass cutoff frequency. The sharpness is determined by the “FILTRESONTABLE” pfield (p8). Values > 1.0 will cause self-oscillation of the filter, producing a tone at the lowpass cutoff frequency.
The setting of the amplitude multiplier (p3, “AMP”) can be a little tricky. If the filter saturates (clips), it will ‘explode’ (i.e. produce an infinite output – the result is no sound).
MOOGVCF can produce either stereo or mono output.
very basic:
rtsetparams(44100, 2)
load("WAVETABLE")
load("MOOGVCF")
// feed wavetable into filter
bus_config("WAVETABLE", "aux 0 out")
bus_config("MOOGVCF", "aux 0 in", "out 0-1")
dur = 10.0
amp = 10000
pitch = 6.00
wavet = maketable("wave", 15000, "saw30")
WAVETABLE(0, dur, amp, pitch, 0, wavet)
WAVETABLE(0, dur, amp, pitch+.0005, 0, wavet)
amp = 20.0
env = maketable("line", 1000, 0,1, 7,1, 10,0)
lowcf = 500
highcf = 1500
lowres = 0.1
highres = 0.9
cf = maketable("line", "nonorm", 2000, 0,lowcf, dur*.2,lowcf, dur*.5,highcf, dur,lowcf)
res = maketable("line", "nonorm", 2000, 0,lowres, 1,highres, 2,lowres)
MOOGVCF(0, 0, dur, amp * env, inchan=0, pan=0.5, bypass=0, cf, res)
maketable, BUTTER, ELL, EQ, FIR, FILTERBANK, FILTSWEEP, FOLLOWBUTTER, IIR, JFIR, FILTSWEEP, MULTEQ SPECTEQ, SPECTEQ2