I've been trying to figure out an efficient way to do general parameter smoothing for a while now, but I just can't get it down. In Reaktor, I would just use the Mnogo Smusas macro (found in some of NI's ensembles) and it worked perfectly. Well now I'm trying to work with C++ (using JUCE) and I can't get it right. From what I understand, Mnogo Smusas just interpolates across the previous and current values over a specified amount of time, in a rather neat way. How would you do this in C++? Has anyone made a class specifically for this? Any help or tips would be greatly appreciated. I can't even make a simple gain control without hearing crackles!
Some questions/thoughts that occur to me. I assume that you would "process" the smoothing on the audio process (or maybe event timers?) if you have a ramp that crossfades between previous and current values over time. Is this right? Well how would you make it only process the smoothing when the parameters actually change? I was thinking that just a simple duplicate filter would work (only processing if current != previous), but I'm not too sure about that. Also, I'm wondering if you would process on every sample. When I think about a ramp going from 0->1 over a specified amount of time, I think about a ramp oscillator or phase accumulator, which I believe needs to be processed every sample to get the correct amount of time (or frequency).
I think all I really need is to figure out how to trigger a single cycle ramp oscillator when a parameter changes and use that to control the crossfade position for previous and current values. Any ideas or working code? I know some of you have to have a good way to do this.
I used smothers for a lot of things in Reaktor and I'd love to be able to do it here.
