Click detector

Anybody knows any useful literature on click detectors? This is not JUCE specific but I’m sure many of you have gone through the same problem. I’m also new to the DSP module that was recently introduced so I wonder if there is something related there.

The problem: I’m trying to figure out if some audio loops that I’m playing are click-free or need a fade in/out.

I’ve found this one by googling quickly:
Sounds quite reasonable. Any suggestions for the “sensitivity” value?

Maybe you simply want detect zero crossing?

Thanks, that sounds like the simpler approach, yes. Do you think it is consistent? Did it work on cymbals for you? Any advice for the epsilon?

The equation you posted has not so much to do with zero crossing detection, I assume you want to find out if the last sample of your loop buffer is near the first one to avoid big jumps, right? It might be possible that you’ll find such a case but it’s luck and relatively unlikely.
Zero detection means that you should modify your buffer in such a way that it always starts and ends with a sample with the value zero. You do that by scanning the start and end of your buffer for the first / last time your sample values change from positive to negative or the other way round.

Now you could try just setting all samples before and after that point hard to zero or apply a gain ramp over a few samples at the beginning and the end of the buffer. Give it a try, maybe it is that simple.

By the way, I just had a quick look at the link from your first post. Seems like the topic there is spotting clicks in recorded material that were caused by bad cables, microphones or something like that rather than smoothing out artificial clicking caused by cuts that are not located at a zero crossing point.

Thanks for your comment and for giving more info about zero crossing. I was thinking more in terms in continuity which would be at 0 when the sample starts.

This is what I was trying to avoid (fade ins and outs or ramps) to avoid changing in any way loops that are already well recorded… It won’t be perceptible most of the times if it is a ramp of a few samples but I wonder if there are extreme cases where this would be an issue (eg. little changes in the attack of a note can have a big perceptive effect).

I think you are assuming much more change to the audio material than what will actually really happen to it. Just think of how many zero crossings there actually are in one single note. I‘m not 100% sure but I think I remember e.g. Pro Tools doing such a manipulation any time audio material is cut in a track. Never hat the impression of any audible degradation of the audio even if aplying tightly timed cuts. Have you given it a try and really heard any degradation of your material?

1 Like

Interesting. Yes I have tried with some drum loops and if I play a ramp less than 20ms long, there isn’t a big change of course but I wonder if anybody has studied in depth this subject. I’m dealing with live loops with beats which have sometimes negative swing (the first note might start at the end of the loop) so I’m afraid applying ramps in-between could degrade the quality of the sound for example for “clean” kicks and sub basses where zerocrossings don’t happen so often.
ProTools was coded at a time where computing power was more limited so I’m asking myself if it can be done better. Actually many modern synths still introduce sometimes-annoying clicks in their bass sounds (e.g. Spire just recently introduced a “click removal” option).