groove~ loop with no clicks
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. :)
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:
----------begin_max5_patcher---------- 1735.3oc6a0rbihCD9rmpl2AJNtalTHI9ceP18vTSkRFjIZGLhBvIYxTad1W jDfAGKrrCfYxjCAbDHT2ecqta8g3me9SqLWydhTXZ7WFe0X0peV0xJQa7VV0 zvJys3mBSvEhazrHjkQdw7l5qkgKCumlFeWNIrT9jrcP2ZciAB4xOArr3mbp NZ7sldQiDOK15+8K11sOqzcaooIjRw.A6zJaWYSyVsCbNofjVhKorzdCtsXv cB3mrpOX7MQu9uO+I94pS2Lh5Kx1Upu9J02bbZLQd2eAHtqasbNNbfNO33h0 qP11sU3W6nURdRnOlqIIIsstgkVVPeVH6.tjqFF.NbEC5KTeeAj.UZzg8FgT 7VwHX92j7HbJ93P.3x7H5IWifCgRfqLGmQdlUolWB5IbagRu2SgdfYD85JWS I5kxLdjlFwd7M36A8zA8rlczCAmZzCZDQ2rgjWcwZXz.mkkyvg2WEfu41Sno jP1tTQePW.NaijJjaG2TaOE.MJX9.Zjqzn6EL0HcBikYji2lcI9oHfL5OR3n JEVkNpH+QD+tXfHk7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9vpnWZ.stBUvELHoGfQbCzAFeuPzX60Ie+8Pewti.Au0Y.uNf274043z 4ceOBtcJQT3DgnNt5fntyGhZWy8iyTinfIBQgA5fnNiHhdwXSLllt+6WX.Ra ELjcZcu9Sq.XIW9spc+K.bdjxN5AwKHIURNK+ECzESksNvgbycCQmHV9kjkz dr8EHOGgCG7iYQpT1xUJJmlZ6nPmBloOUEUV3coY3vuWE5nCKe5ah2Tkkuj6 2K+wvuqB4N1S9RJ7sFzROh6Za3jTYCOXoHalgik+sic.xZnR9EB.fCiUdKgB bTF.gF+xzD4.3J+FwpimNHD4tDfnRVbbBQcRjSl5nViQVM4LNLyw53PVBKu4 UbA8rc.hOSNdoA.KGeen3eOJF4bk8ThyYrGHuXPdBuMqCNMQu4zZvrl.bfMb 3Wc5E3.glq3Qq2w+pkZQNC9BqYemPtES27FBoe5kgEH2B1B.za3OnD3zEPWN d849rFPOjvmFX80Ts0ee5nfjG6965jiPviBxcNp0VegCpkvgtNBW+QUA6XtW MYCnkrAleYyUGfiWwqAZgZTgKXiJ75XTgZaTgytv4oir4eUroPKsb3tJxFHP GY6PMXtDNGsc3tBBm6RV37VxBGPGgK3pDiSeY6JfaZEG4PMXIkTUnAyuQ0Wq jpWkzV95lZX9QM2kaVKsxK71qJm2P0o+GUYBZzB -----------end_max5_patcher-----------
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…
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.
I love JoelisRich’s tutorials. He’s got a great sense of humor.