How to eliminate audio clicks in Wavulike

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?

Sounds reasonable to me. I guess in the abstract it might be more “conventional” to cross-fade from the old waveform to the new. But if you have the duck half working, yeah, make it right. Also, cross-fade sounds more complicated :wink:

Right, cross-fade was how I tried to do it in the original module design, and not only could I not get it to work correctly, but it also means I have to generate the waveform twice (or more times for anti-aliasing) and so is most likely less performant. Plus I like ducks :duck: :duck: :duck:

1 Like

Ok, basically got it working now, maybe a little clean up to do

This is a change of 0.002 per frame, which is 1000 frames for the auto-duck, which is very roughly a little bit more than 20ms by my calculations, so I can probably play with that value and get it lower

1 Like