all purpose groove~ playback engine.

kp*'s icon

I am making the transition from play~ to groove for my buffer tomfollery. I find that play~ is much easier to use in some ways but for some longer files, groove sounds better and groove has other virtues so it is good to have booth at the ready.

So the goal was to make an all purpose playback engine that uses groove and also:

1. Works off a set of numbered buffers like "foo.1 foo.2" by just choosing the number portion so that we can algorithmically pick and play buffers. Sprintf does this nicely. I am almost 100% sure this works as intended.

2. Play at any speed 0. to 1. (that is all i usually use).

So far all of this was easy. But

3. *and* play backwards. This was tricky.

What I have seems to work. I can't believe that this is the most elegant way to do this but this was the best I could figure.

The trick is to bang info~ after you choose a buffer and get the length of the current buffer and use that as the playback start position but only if going backwards. Otherwise we can just send 0. as the inskip & the buffer symbol. So you needed to use some conditionals. I just used the brute force if object. Kludge shame abounds.

--
Concerns:

1. I am not sure it works in all cases (seems too) or that the order of operations is entirely correct. I aimed to set the input to sig first then the float for the playback start position then the buffer. Perhaps that is wrong, or perhaps that isn't the order I am actually getting anyway.

2. I haven't tried looping anything yet, but i don't see why that woundn't work.

3. I am suspicious of the fact that I didn't need to send the stop message.

and (file under: I know this broke but it is 5 am):

4. the "bang when done" of splay (or the line~ you used to control play~) is gone, so we need to hack one together. Turns out there is one you can crib from the help patcher. Which works great in the case that you are playing forward. It doesn't bang when done if you play backwards, which sucks. I need to fix that since i used the bang when done jibby in play~ & sfplay a ton.

It is a small patch. Any improvements or fixes welcome.

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