A couple important bugs in BiquadFilter

23 views
Skip to first unread message

Roy.Lachapelle

unread,
Apr 12, 2021, 6:11:39 PM4/12/21
to beadsproject
Not sure how BiquadFilter has been out there so long with these bugs, but I think these need to be fixed (please tell me if I'm wrong - because I'd be really confused if I was).

I'd like to thank Ollie for some wonderful learning experiences, allowing others to gain insight from the Beads source code.  I've been building a unit generator app for a couple years for fun in my spare time.  No beads, no dependencies...  Triggers and envelopes are "in-line".  No clock, but I have a metronome that replaces it.  It works great for my use.  I hope to make it available to others.  At the risk of building a competing product (I consider it an homage to Ollie's work actually), I'll go on a limb here.  In my search for better filters, I could not get Beads BiquadFilter to work quite as expected.  I think this may be a factor.  Q and Gain are being assigned the value of the frequency ugen during setting.  This may not be an issue when modulating ugens are used, but when they are all static, the q and gain seem to be incorrect, affecting the coefficient calculations:

q = freqUGen.getValue();
should be
q =  qUGen.getValue();

and

gain = freqUGen.getValue();
should be
gain =  gainUGen.getValue();

See method:

public BiquadFilter setQ(UGen nqval) {
if (nqval == null) {
setQ(q);
} else {
qUGen = nqval;
qUGen.update();
q = freqUGen.getValue();
isQStatic = false;
areAllStatic = false;
}
vc.calcVals();
return this;
}

And this method:

public BiquadFilter setGain(UGen ngain) {
if (ngain == null) {
setGain(gain);
} else {
gainUGen = ngain;
gainUGen.update();
gain = freqUGen.getValue();
isGainStatic = false;
areAllStatic = false;
}
vc.calcVals();
return this;
}

Ollie Bown

unread,
Apr 13, 2021, 5:01:37 AM4/13/21
to beadsp...@googlegroups.com
Hi Roy,

thanks for the kind words and good luck with your project.

Please log an issue https://github.com/orsjb/beads/issues. I can’t guarantee when it will be looked at, sadly. Always looking for smart folks to get involved in maintenance, if you’d like commit privileges. 

Best,

Ollie

--
You received this message because you are subscribed to the Google Groups "beadsproject" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beadsproject...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beadsproject/66b440e2-a043-42c1-9718-23e8261fd86cn%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages