AudioProcessorGraph: Clicks & Pops

Hi all,

I’m currently building a plug-in that uses an AudioProcessorGraph to cascade different audio effects in a similar way as the JUCE AudioPluginHost. When connections are added/removed, clicks and pops occur. Gain ramping seems to be the thing I’m looking for, but I was wondering if anybody knows of nice way to implement this with the AudioProcessorGraph.

My current version uses juce::LinearSmoothedValue. It fades the output gain to 0, adds/removes the connection and then fades it back up again. It feels kind of overengineered and inefficient though. Anybody got an idea?


That’s basically what is need to be done. The only more efficient solution would be stopping all audio processing (i.e a global “noProcess” flag in the beginning of each processBlock that returns if true), but it would be an uglier solution and I can’t guarantee it won’t create some pops in some situations. Tbh fading the gain is pretty cheap in modern CPUs.