I initialize the filter once, before the plugin starts.earlevel wrote: You may just be stating it in an awkward way that you don't intend, but...you do not want to initialize the filter when it changes. You'll have many incoming changes as the knob turns, and the filter should just continue to roll.
I'm setting a0 in this way now:earlevel wrote: If you're running it at the sample rate, b1 should be in the 0.999 area (and a0 = 1 - b1). Looking at Echo Farm, it looks like I used 10 Hz for most of the knobs, and I wanted the delay knob to be very slushy to get the effect of a tape delay changing, so it's 0.7 Hz. That's about 0.9986 and 0.9999, respectively, at 44.1 kHz. In other words, your a0 should be a couple of orders of magnitude smaller.
If you're running the filter at 44.1 kHz, for instance, you have your filter cutoff at 740 Hz, and that's why you're getting zipper noise.
Code: Select all
a0 = 1 - exp(-1 / (0.05 * samplingrate));
b1 = 1 - a0;
Code: Select all
inline float process(float x){ z1 = (x * a0) + (z1 * b1); return z1; };
So it would be correct to reset the filter only when the knob drag is ended instead of whenever its value changes?earlevel wrote: But you also can't be resetting the filter when the knob moves—that will give you zipper noise too.