I’m trying to create a click-free gain knob, like the one found in Pro-Q 3, but I’m having some issues.
I’ve tried several things but all have their downsides:
No smoothing - The Gain value is directly attached to the Slider value, and the Gain value is simply read at the start of each processBlock, then applied. This leads to a lot of popping and crackling when moving the Slider no matter how small or big the gain change is, so it’s a no-go.
Smoothing at a fixed approach velocity - The Gain value is not directly attached to the Slider value, but each sample a small step (e.g 0.005/sampleRate for a 5ms ramp from 0 to 1 or a 2.5ms ramp from 0.5 to 1) is added/subtracted from the current actual value until it reaches the value of the Slider, effectively making the actual Gain “follow” the Slider value. This worked fantastically but had the downside that it introduced some crackles in the low frequencies while moving the Slider. Changing the ramp rate did affect the sound of the crackle, but it never disappeared completely.
Starting a new fade on every Slider update - Every time the Slider value is changed, a new fade is started from the current actual Gain to Slider value. This worked fantastically when the user is changing the Slider, as it stops often enough that the fade had time to approach the target value. No artifacts were heard. The only problem is that the responsiveness is heavily affected by block size, with lower block sizes being more prone to “stalling”, so that if the Slider gets automated or moved constantly, the actual Gain will take lots of time before reaching the target Gain.
To be clear, some lost responsiveness is not an issue and the smoothing gives a nice feel, so the 3rd option has been pretty good. I just haven’t found a way to make it work consistently across block sizes, which is a no-go as it affects the sound if there is any automation of the parameter.
These are the methods I’ve tried so far. Am I missing some other solution or are there always downsides? Would anyone happen to know how high-end plugins like Pro-Q 3 handles this?
I’d be really thankful for any help with this one.