Remove Clicks

Kelvin Walls's icon

I'm trying to remove the clicks from a patch where a bang plays a random second of an audio file with an envelope controlling the amplitude. The issue comes when I try to start a new sec/envelope before the previous has finished.

I can remove the clicks that come from the amplitude abruptly jumping to zero with a the start of a new envelope by having it go to 0 over 5 (or whatever) milliseconds, or I can remove the clicks that come from abruptly jumping from one random part of the audio file to the next by hiding it with an amplitude envelope that starts from zero at the same time as the jump, but I can't do both.

Idk if I'm doing a good job explaining my issue but it might make more sense if you check out the patch I have attached.

topicpatch.maxpat
Max Patch

daddymax's icon

Have you considered using the MC objects to get multiple channels of audio? If you retain your envelope idea with the short fades, but also have (at least) two voices that will mean that there won't be a click at the start, as the envelope tames it, and there won't be one where the new section starts, as it will trigger a second voice rather than cutting off your audio mid-stream and risking a click. Just have it cycle between voices every time a new section starts.

Kelvin Walls's icon

Hmmmm... I'll give it a shot! Thnx

11OLSEN's icon

You can avoid fade ins if you make sure to jump to a zero crossing position. But you still need 2 voices or you have to wait for the fade out to be finished. You will need 25 or 30 ms for the fade out or you will still hear clicks if it's low frequency material.