Replicating reson~ in gen~ with wider Q and gain [solved]
Hi,
I’m trying to replicate exactly reson~ object in gen~ but it’s beyond my gen (and filter designing) capabilities.
I’m trying to modify the cycling code (help->examples->gen->gen.filters) to add the gain parameter and to have a wider Q (the reson~ objects allows numbers larger than 100, which is the "sonic" limit in the gen~ version) but no luck until now.
Any help really appreciated!
Cheers
// filter input/output history:
History x1, x2, y1, y2;
x = in1; // input signal
cf = in2; // cutoff frequency
q = in3; // Q factor
// calculate coefficients:
twopi_over_sr = twopi/samplerate;
bw = cf/q; // bandwidth
r = exp(-bw*twopi_over_sr);
c1 = 2*r*cos(cf * twopi_over_sr);
c2 = -r*r;
// generate output:
y = (1-r) * (x - r*x2) + c1*y1 + c2*y2;
// filter history cascade:
y2 = y1;
y1 = y;
x2 = x1;
x1 = x;
out1 = y;
A storm in a teacup… Solved.
Hey! would love to know how you solved this currently doing the same.
Hi there! I'd love to see the solution to this as well!