While updating my Wavulike module for V2 I thought I might try implementing a new feature that has been in the back of my mind for awhile.
There currently exists an issue with the module where if you change the number of active points in the waveform, it typically generates an audio click.
I had up until now assumed this was due to the abrupt change in the output.
So the feature I implemented is a simple “auto-duck” whereby the internal VCA will be dipped down when the active points param changes, with the goal of covering the abrupt change in waveform and therefore removing the audio click. (The implementation is currently exaggerated to approx 100ms so I can actually perceive it).
As I am writing out this post I have realised why my implementation does not work…
The audio click is produced when the output jumps from one value to another in subsequent frames (or a short number of frames).
My implementation smooths from zero up to the new waveform, but it does not smooth from the previous waveform down to zero before this, it just cuts the VCA, thus the audio click is still present (unless the waveform coincidentally happens to be crossing zero at that exact moment, or is at a high enough frequency that the click is masked).
The question is, how do I best implement this auto-duck feature so that it smooths both sides of the change in waveform?
I think I will need to delay the change in waveform during the VCA smooth down to zero, once this is working I could probably reduce the length to around 5-10ms and remove the audio click without the VCA duck being very noticeable.
But is there a better way to achieve this?