Hmmm. I made a moog-style filter last year, but it's an external of course. Totally ripped from source code I found elsewhere, but it may help if you look at the algorithm for the filter's operation.
Note that this is an IIR not an FIR filter, so it can burst and screw up your DSP chain (but only if you feed it bad values). Everything is signal-based - i.e. cutoff frequency and resonance.
Cheers,
Ed
while (n--) {
i1=(*in++);
fc1 = (*fc++);
/* This failsafe line stops the filter bursting
* ...but it is expensive! */
// if(x->safety) {
// fc1 = fc1 <= 1 ? fc1 >= 0 ? fc1 : 0 : 1;
//
}
res1 = (*res++);
q = 1.0f - fc1;
p = fc1 + 0.8f * fc1 * q;
fcoeff = p + p - 1.0f;
q = res1 * (1.0f + 0.5f * q * (1.0f - q + 5.6f * q * q));
i1 -= q * xb4; //feedback
t1 = xb1;
xb1 = (i1 + xb0) * p - xb1 * fcoeff;
t2 = xb2;
xb2 = (xb1 + t1) * p - xb2 * fcoeff;
t1 = xb3;
xb3 = (xb2 + t2) * p - xb3 * fcoeff;
xb4 = (xb3 + t1) * p - xb4 * fcoeff;
xb4 = saturate(xb4);
xb4 = xb4 - xb4 * xb4 * xb4 * 0.01f;
xb0 = i1;
*out++ = xb4*1.414; //
lowpass mode
// *out++ = i1 - x->b4; // highpass mode
// Lowpass output: xb4
// Highpass output: in - xb4;
// Bandpass output: 3.0f * (b3 - xb4);
}
Ninja Jamm - a revolutionary new music remix app from Ninja Tune and Seeper, for iPhone and iPad
http://www.ninjajamm.com/
Gemnotes-0.2: Live music notation for Pure Data, now with dynamics!
http://sharktracks.co.uk/
On Tuesday, 15 October 2013, 13:16, Billy Stiltner
<billy.stiltner@gmail.com> wrote:
martin, I have not tried the moog but did use one of your abstractions using the fexpr~ as a starting point to build the original dsp cookbook filters(frequency thats where its happenin man) , I had been wanting to hear them in realtime since 1998 or so. I'm not sure I have them in there correct as they are over resonant but make a nice oscillator for drums if properly limited.