Max help: buffer scrub with waveform~ and groove~

Okay, getting into Max these days and it’s doing my head I in (as expected)… I’m trying to build a patch that scrubs a fixed loop randomly around in a buffer. I’m using waveform~ and groove~.

For the life of me I can’t get the loop length to stay fixed, there’s always discrepancy. I’m just using a simple random for the start time and adding an offset value to it for the end time, but the loop size is expanding and contracting. I don’t get it.

Try to pull off something like this:

1 Like

ugh, it is probably not helpful to just recommend going an entirely different route, but: karma~ karma~ karma~. @Rodrigo can weigh in more on this, but if you’re looking to record in and manipulate live (or even just load a file to scrub), that would be something worthwhile to investigate. it’s got all the best groove~ and waveform~ tricks built into its core functionality.


Groove expects a beginning and ending time, so if you want want to have a fixed length loop, you need to update both values (not just the ending (or start) time), if that makes sense.

If you share your patch I can help in more detail.

As @dan_derks mentioned, however, karma~ is built exactly for this kind of thing, and the paradigm of “position” and “window” (vs “start time” and “end time” in groove~) makes this stuff much easier, as you can literally keep a fixed “window” size, and just vary the position.

You can download karma~ via the package manager in Max7 (or here).


I’ve got karma~ installed already (it’s great). But I still want to figure this out, even just for the sake of learning and improving my logic skills.

1 Like

Basically I’m sending these two values to the start and end time, but I guess one is being updated before the other…

There’s bondo, but I don’t really understand that one (plus it doesn’t seem to be helping)

What’s weird is it seems like the end point value is just not updating sometimes… but I don’t understand why it wouldn’t, since it’s the same value I’m sending the start point + a fixed number :confused:

Here’s the patch if anone wants to muck around

waveform test.maxpat (49.7 KB)

What’s happening is that the playhead is escaping your start/end points, and the way groove~ handles that is weird/inconsistent.

If you do this, it will work as (I think) you think it should:

This way it sets the start position and then jumps to that same start position.

1 Like

That actually didn’t work @Rodrigo… I had to add the [t f f] inside the random subpatcher instead (and lose the line - for now), BUT now it works like I want/expect :smile:



But yeah, that part of “losing the playhead” was a big inspiration for karma~. In karma~ the position/window always contains the playhead, no matter what, so you can do some wild things with that.

Can you scrub around using a mouse/trackpad on a waveform~ with karma~?

Yup. If you look at the “Granular-ish” example in the ‘misc’ tab of the help file, you can see/hear that. (by moving the position parameter)

You can do it with the waveform display by scaling the waveform output to 0. to 1. doing the same trick you do (divide the start position by the sample length to get a phase value between 0. and 1.)

1 Like