Forums > MaxMSP

groove~ loop with no clicks

January 2, 2011 | 4:25 pm

Hi All!

I’m working on a sampler, that plays the first part of a sample and then loops later in the sample. The amplitude is faded out through this loop.

I’m using the buffer~ and the groove~ objects in the core of the playback. The problem is, that the loop-function in the groove~ object often makes a click, when it loops. Is there a way to avoid this clicking?

I’ve checked out these forums and the examples-folder in the Max-folder, but the stuff I’ve found there is to complicated for me. Is there a rather simpler approach to solving this problem?

Any suggestions would be very appreciated. :)

January 2, 2011 | 6:08 pm

Hi there M,

check this one out;


January 2, 2011 | 9:12 pm

When the sample values at the end/start of any loop are different, you will hear the discontinuity as a click – it’s unavoidable, but there are numerous solutions. One is to ensure that the loop end/start point is always a sample value of zero – I believe this is achievable using the [waveform~] object and its ‘snap to zero’ message; a second way is to send the [groove~] object a [loopinterp 1] message, which performs a smoothing function on loop end/start points; alternatively you could use the [grooveduck] object which allows user-variable fades on the loop end/start. A third option is to use the right outlet of [groove~] (which gives a signal ramp from 0. to 1. over the duration of any loop) to apply an amplitude ‘window’ that hides the clicks. The attached patch demonstrates two basic uses of this ramp to avoid clicks:

— Pasted Max Patch, click to expand. —


January 2, 2011 | 10:29 pm

Thank you so much, both of you! I’ve been playing around with the different ideas and learned a lot! :)

JoelisRich (from YouTube), [grooveduck] and the amplitude ‘window’ works fine with voice samples, etc. – but with instrument tones the ducking/fades becomes as notable as the clicks.

Sending the [groove~] object a [loopinterp 1] message helps but doesn’t avoid clicks (or sudden changes of the tone).

[waveform~] object and the ‘snap to zero’ message has made a couple of good results – but it takes a while to adjust it for each sample.

Maybe the best approach would be a kind of crossfade between two buffers, that plays the same loop? (but I can’t figure out exactly how to build it, a little start help would be nice!)

I’ve uploaded a sample that I trying to make the sampler eat…

  1. FluteC4max.wav
January 2, 2011 | 10:40 pm

This type of looping sampler is only ever as good as the samples you use; you really need to try to get very clean sustained tones, and tidy them up in an audio editor. Search the forum for "looper", "sampler" or "groove + window" etc for further help.

January 3, 2011 | 12:47 am

I love JoelisRich’s tutorials. He’s got a great sense of humor.

Viewing 6 posts - 1 through 6 (of 6 total)

Forums > MaxMSP