A simple button to advance to the next clip

Hattie Dog's icon

As above, i'm new to M4L but can not seem to fathom how to create a simple bang button to launch the next clip down in the track?

All help greatly appreciated.

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

You need to observe the playing_slot_index, and then tell the next (or previous) clip to play when you hit the bang. Try this:

Hattie Dog's icon

Thanks ever so much for this ... however when I use it within a max for live midi device it stops the playback of the track.

I forgot to mention it's a midi instrument that i'm running on that channel.

Evan's icon

Nah, that doesn't happen, I just made three clips in a midi track, put this code inside a M4L Midi device, added an operator after, and was able to move through the clips.

You'll have to give me more info than that, something else must be going on.

Hattie Dog's icon

Here's a screenshot of what it all looks like ... hopefully this will show you what i'm doing wrong.

Screen-Shot-2015-12-04-at-19.05.49.png
png
Evan's icon

That actually doesn't help at all haha.
Nothing seems to be playing, and you can't send the path to the track through the patch, because you can't click on the message box that contains the path (maybe)?
I didn't make a finished device for you, I just showed you how to get to the function calls you need in the API.

Hattie Dog's icon

It's now playing once I've got the midi in and out in there.... maybe I'm trying to use it as a finished device then.

I think the idea is there, all I'd like it to do is to advance to the next clip when a bang is pressed ... completely foxed me :P

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

There's all the code for a complete device. Oh yeah I think you do need either midiin/out our plugin~/out~ in a M4L device. The one above is a nicely packaged version that operates on the track the device is on.

Hattie Dog's icon

You sir, are an absolutely beautiful human! I really appreciate this - now to go through it all and find out what you did