In our recent updates and releases such as Sloth and Butterfly we have included Parameter Smoothing, but what exactly does it do? Let’s take a closer look at what it means, what it does and why you should care.
As with the JUCR standards and implementations, parameters within a plugin are updated once per Block of audio-data. This means a plugin does not receive a continuous stream of updates at every sample, but bigger discrete, stepwise updates at a certain intervals.
Let’s take a closer look at a real-life example, such as a Gain parameter. The number of samples per Block depends on your hardware and software settings, but for this case, let’s assume we are using a size of 512 samples at a sample rate of 44.1 kHz. This means that every 11 milliseconds, we will receive a new Block of data that includes all the changes made to any of the parameters.
During a Block, no new values are received, meaning the parameters are staying at their current values until the next update comes in. Consequently, any new values that are received during the processing of the current Block are ignored, causing jumps between the changes until the next Block starts. Untreated, this can result in all sorts of unwanted sound glitches or artifacts if not accounted for.
Let’s take another look at the gain parameter. At the beginning of every Block, the parameter jumps to a new value, leading to a sudden change in output volume, which as a result can be perceived as a distortion, click, or anything similar.
The solution to this problem is called ‘Sample-Accurate Parameter Smoothing.’ The concept is to Interpolate the values of the parameters over a specific amount of time (more on the specific timing in the last section) in order to account for any sudden changes. There are multiple ways to approach this, with the most common ones including:
Regardless of the method used, this avoids sudden changes in the parameters, resulting in a smoother and cleaner audio experience.
The approach described above works very well for parameters that can be directly applied without complex internal recalculations. However, from a performance perspective, this recalculation often cannot happen for every single sample, as it would be too computationally expensive.
A good example of this is with equalizers. They typically follow a two-step process:
While calculating the coefficients can be a demanding operation (often involving trigonometric functions), processing each sample with a given set of coefficients is relatively inexpensive.
Calculating the filter coefficients for every single sample is not practical. Therefore, another option is available:
This method limits expensive recalculations while still providing the benefits of parameter Smoothing.
There is a simple, manual test that can be applied to most plugins to check if parameter Smoothing is implemented:
Load the plugin on any audio track and automate its parameters using an LFO or rapidly change the values via the user interface. If you hear any crackling, sudden jumps, zipping sounds, or glitches, it’s likely that there are issues with parameter Smoothing.
Before you start testing it's highly recommended to use a brickwall limiter at the end of your signal chain in order to prevent the signal destroying your ears and/or speakers.
However, depending on the plugin’s effect and the source material, these artifacts can be difficult to hear. To make them more obvious, the following procedure can be applied:
This approach will harshly highlight any issues with parameter Smoothing and is an excellent way to isolate any audio glitches caused by it. Additionally, it helps you find suitable timing for parameter Smoothing by ear.
There are two conflicting requirements for the Smoothing time:
There is no single optimal value, but the following has worked well for me:
For most direct parameters, such as a gain slider, the Smoothing time can be relatively short, like a few milliseconds.
For some filters, especially those with a high Q factor and operating close to (or in) self-oscillation, you might want to use longer Smoothing times.