anthonyalfimov / Stable-Delay

AU, VST3. A WIP delay/chorus/flanger plugin
GNU General Public License v3.0
3 stars 1 forks source link

If parameter is changed when transport is stopped, it will start smoothing when playback starts #68

Open anthonyalfimov opened 2 years ago

anthonyalfimov commented 2 years ago

Audio parameter smoothing only occurs when the plugin is processing audio. When a parameter is changed while transport is stopped, it updates the target value for smoothing. But smoothing only starts when transport is started. This can lead to unwanted artefacts.

The specific case where I discovered this issue is bouncing the plugin output.

This issue currently is most prominent with the "Drive" parameter and when changing the "FX Type" from "Delay" to "Chorus" or "Flanger".


Changing the "Drive" parameter when transport is stopped results in a transient boost in wet signal when playback is started:

Screenshot 2021-09-07 at 15 19 03

anthonyalfimov commented 2 years ago

Currently, pre- and post-saturation gain is handled by two GainModules. They use ValueSmoothingTypes::Multiplicative smoothing type for the gain value, so during the smoothing period the pre-boost and post-cut values don't match. This is most likely the cause of the problem.

anthonyalfimov commented 2 years ago

The issue is connected to the smoothing of the "Drive" parameter. However, it is not caused by using multiplicative smoothing on separate pre- and post-saturation gain values. Even when there's just a singe smoothed "Drive" value, the issue persists.

anthonyalfimov commented 2 years ago

The issue is universal for all smoothed parameters. The top post and the title are updated accordingly.

anthonyalfimov commented 2 years ago

While this issue is noticeable only with certain parameters, I believe the best approach is to address this on the level of the SmoothedValue object. E.g., a derived class that checks if the playback has just started, and in that case sets the new value immediately.