groove clicking when changin waveform start end

john one's icon

Hi there i am a begginer in max and i would like to ask the following.
I am trigering a sample with groove and selecting start end point with waveform. When i change those rapidly and especially when length is small i get these clicks.
I saw an example where the clicks where colpmletely gone when the groove was looping with waveform but they do no desapear when i want to trigger the sample in demand. is there a way around this? i have searched and havent found an answer.

thank you in advance

hope somenone can help

Max Patch
Copy patch and select New From Clipboard in Max.

here is the code

Rodrigo's icon

Specifically the bit about 'groove duck'.

Or karma~ declicks everything for you:
https://cycling74.com/tools/karma-samplerlooper-external/

john one's icon

Hi

thanx for your quick reply! karma works great!!!
just one question, how can i trigger the sample once and not repetitively? because it keeps looping till the next trigger...

thanx!!

Rodrigo's icon

You can send a 'stop' message when it gets to the end. Or you can do it automatically using edge~ like you were doing in your example. In the karma~ helpfile in the last tab is a guitar looper type (Line6 DL-4) which has a 'one shot' playback, which doe that.

john one's icon

Hey Rodrigo thank you for all the info! just two more things...
I opened the helpfile you said and i click play once and the play on the left lights and it continous to play in a looping mode... Also I place a small sample and the waveform doesnt show exactly the size of the sample but a much bigger part.... obviously these are stupid questions but unfortunately cant find a solution to them.....

thank you in advance

Rodrigo's icon

(that part of the helpfile isn't perfect. If you have a short sample in there it doesn't catch the end). karma~ is primarily made to loop.

For showing the whole waveform, that happens when you start recording a new loop, but once you hit stop (or play) it should 'shrink' back down to normal.

Or you could be talking about something else. If you load a sample into the buffer with 'replace' it should work fine.

(there's also the funky append mode which does all sorts of things with the display)

john one's icon

Rodrigo thank you for your answers! i am a bit confused though. Since i mainly want to triger very short samples like kick snares etc is there any way you could post an example of a groove or karma that you can trigger the sample just once (no looping) while beeing able to change start and end points with no clicking?
sorry for not beeing able to figure it out.... I tried aswell palcing edge~ but with no result as well.....

Rodrigo's icon
Max Patch
Copy patch and select New From Clipboard in Max.

That gets more complicated if you want to change the start/end points too. karma~ declicks everything, but it's not straightforward to make it "not loop" (primarily because of the state machine of start/stop/play). You're probably best off using regular ole grooveduck:

john one's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Rodrigo i must been driving you crazy, sorry for that! Well the grooveduck seems to work fine when you have samples that are a bit long but when i place a short sample like a kick and then want to change start and end in the waveworm , as i do that, all the clicks appear, which was the issue i had from the start. Are short samples that problematic to remove clicks? I added an example of a sample i want to manipulate just in case you would like to try it out yourself. Again thanx for your response i know my problems are very beginner....

john one's icon

basicalluy i just want to be able to trigger a sample at will without it looping, while beeing able to change its speed and pitch and as well changing live the start and end point while not having any clicks... is that possible?

Rodrigo's icon

I managed to do it with a real small audio file here. Using your example patch, if I turn 'metro' on, it loops, but that's just metro retriggering, groove itself isn't looping anything. It plays whatever you select in the waveform display and then stops.

Could you make an audio example?

Oh, one comment about your first patch, edge~ won't really work with [==~ 1.] because "1." may not arrive every loop. Normally in that usage you'd have[ >~0.999] or something like that.

john one's icon

yes the reason i placed metro was just to have triggers, in order to simulate a moment where you might have 3-4 kicks in a row and while these are triggered you want to change the start and end points. In the patch i posted if you would do this then you would defenately have the clicks. its funny though because some times it seems to work ok and then the clicks appear.... any thoughts? thanx for the edge~ comment as well. by Audio example you mean?

Rodrigo's icon

Actually, can you try making the duck time higher in the example?

Yeah, I meant an audio example.

john one's icon

hey here is a recocording of the clicks when changing start end in waveform while the metro sends bangs to groove duck

john one's icon

wierd it didnt upload before

john one's icon

and it didn't upload again... well i guess what i need is something similar to grooveduck but to work when i change the start and end points on the sample that is triggered. whould that be possible? grooveduck knows when to lower the volume in order to avoid the click, can that be made when someone desides to change the part of the sample that is played?

Rodrigo's icon

Aaaaah, I think what's happening is you are getting clicks before the grooveduck resets.

I missed the bit where you wanted to change the start/end while playing too. I find groove~ to act kind of funky when messing around with start/end dynamically as you can get the playhead to 'escape' the start/end by jumping outside of it, and it exhibits weird behavior in that case (I remember reverse being especially weird).

If you want to get really dynamic karma~ is best, then just using edge >~ 0.999 to stop it. (though you'll have to adjust that number based on whatever the position/window are set to).

john one's icon

Hey Rodrigo, thanx again for the info! for a strange reason i am tryingg since yesterday to post on the thread and it was bringing error…. I tried the edge~ but i think i might have connected it into the wrong place of it just doestn work. I posted a karma help file and placed the edge~, is there any way you could check it? as well is there a way to change pitch in karma and not just speed? also is changing speed similar to timestretch?

Rodrigo's icon

karma~ doesn't have any of the timestretch features of groove~, only playback speed (pitch).

Here, this kind of does what you want, even allowing you to change the 'window' parameter. To add control over 'position' too is more complicated since it "wraps" around the end of the loop, so the math isn't as straight forward, but this should get you 90% of the way there.

Max Patch
Copy patch and select New From Clipboard in Max.

This isn't sample accurate, as the tiny bit you play actually resets and plays a tiny amount of the same from the beginning before stopping, but it's declicked, so you might not notice it.

john one's icon

I am trying to post a patch but for some reason whenever a post the messages dont come throught. so sorry about that. Is there any way you could implement the edge~ on the patch you just sent? because i tried putting it on both lefte and right outlets of karma and it didnt seem to work.... So to conclude there isnt any other way i could use groove~ (since it has timestretch) in a click free way by doing the process described in the post above? ( to be abple to change realtime the end start of sample while trigering when wanted a sample)?

thank you!

Rodrigo's icon

You're probably posting a patch that's too big, so the forum rejects it (it happens to me often, if the patch I'm posting is too big).

edge~ won't work with karma as karma's outlet isn't signal rate. That's why I'm using two objects in the [edgeDetection] subpatch, one to figure out the delta value, and the other to check if the position is greater than 0.9 (or whatever the 'window' is set to).

If you want timestretch too, then you are back to using groove~. It is possible to do what you want with groove without clicking, but it's complicated. Generally speaking, removing clicks is "complicated", hence the creation of karma~.

My suggestion is to weigh your options (karma vs groove) and work with one of them while you build other things, and try to figure out how to remove the clicks, or stop karma exactly how you want.

john one's icon

Cool man, and thanx for your time, I will do that then. do you know then why "play once " in karma isn't working? is there something i am doing wrong?

also in the groove option, is there any way you could think for removing clicks when changing the position in real time? (as you said its complicated but is there any way yhat you could suggest?)

Rodrigo's icon

Try sending it a [report 10] message, or perhaps even smaller. I suspect the issue you are having with really short samples is that the sync outlet is moving so fast that sometimes it does't go above 0.9.

The way that it would happen is only changing position once the phasor has gone around a cycle. It's kind of difficult to explain, but it's also harder to implement.

If you look through raja's sampling tutorial it covers some of the concepts, but that is something that would give me a hard time programming.

john one's icon

Great will do that!
thanx again youve been really helpful!!