This filter has some sweet spots (I really dig the sound of its self-oscillation), but it needs work. The differential equations I used as a starting point are:
dy1/dt = f*(in - y1 - g(r*y2))
dy2/dt = f*(y1 - y2 + g(r*y2))
where 'r' is resonance, 'g()' is the nonlinear function. Certainly additional equations are needed to improve the sound, I keep it as simple as possible. Any suggestions welcome!
The code:
// evaluate the non-linear gain
double t = tanhXdX(r * yl2);
// solve the linearized system
double denom = f* f * r* t + f *(f + 1) + f + 1;
double y1 =(-f* r *t *yl2 + (f + 1)* yl1 + f* (f + 1)* in) / denom;
double y2 = (f* yl2 + yl2 + f * yl1 + f* f* in) / denom;
// update state
yl1 += f*2 * (in - y1 - r*t*y2);
yl2 += f*2 * (y1 + r*t*y2 - y2);
