Quickly set value of lowpassed parameters


I’d like to smooth my audio parameters with a lowpass filter. When I detect a transport change I’d like to forego the smoothing and jump right to the new value (in the case of automation, etc). How can I do this efficiently?

One way to do it would be to just run a bunch of the target value through the smoothing filter until it eventually converges to the value, but that’s super inefficient. Another way is to change the IIR Coefficients to be a lowpass filter all the way at nyquist and then you need to run even less samples through, but that’s still kinda hacky.

Based on some testing, I believe Serum (popular VST synth) does this, and I’d love to know how the creator pulled it off.


How do you know it is inefficient in a way that matters? Did you try it? A simple parameter value smoothing filter doesn’t do much compared to a non-trivial DSP algorithm. (And even with a trivial DSP like gain change, you probably need to do some smoothing anyway and maybe even for each sample calculated…)


I use a bilinear LPF for dezipping and estimate the filter state in my prepare() routine. After debugging and doing a bit of work in Excel, I determined that SR/(2Pifc) was a decent estimate. YMMV


I am dumb. There’s one value you can always quickly jump to using plain ol’ JUCE code… zero! So, just maintain an offset to zero and every time you need to quickly jump, reset your filter to zero and change the offset.