Forums > Max For Live

Stepping through a MIDI Clip with m4l

October 10, 2013 | 10:21 am

Hi all -

I’ve seen this topic broached elsewhere, but I still am not sure if this is possible or not..

I’d like to send a simple bang from Max to Ableton, to cycle through a MIDI clip, step-by-step. Is there any way to do this or something equivalent?

October 10, 2013 | 10:21 am

Preferably not reprogramming the MIDI with the live.step abstraction.

October 12, 2013 | 2:36 pm

No one has tried to do this?

October 12, 2013 | 5:17 pm

Do you mean cycle through the notes like round robin? Because I’m just tidying up a device that’s about to be released.

October 13, 2013 | 2:52 am

I just rolled up something that… kind of works, but I can’t get the get_notes method to work. Like, at all. Mooter, is that your approach?

The way I’d do it is with select_all_notes, which has its usability downfalls.

October 13, 2013 | 5:41 am

Yeah I used the get note, but within the boundaries of Live’s clip loop.

Here’s a straight copy from my "extract" encapsulation:


– Pasted Max Patch, click to expand. –


First you want to have your midi clip selected since it uses [detail_clip] to get the notes.
Then the notes are placed by order of time into a dictionary, which you can then use a counter to fire off the keys to send the midi notes. That’s pretty much it.

One handy thing (thanks to some assistance on here) is that notes that are close together under 1/16th note will be rounded off to be put in the same dictionary key. This is because if you have human input playing some chords, obviously the notes in the chord won’t be recorded at the exact same time, which means they would be entered as single notes in the dictionary and the chord wouldn’t be fired, it would fire each note independently.

I hope this is helpful!

October 13, 2013 | 10:47 am

Alright- GetSelectedNotes dumps MIDI to a Jitter Matrix, which then has to be reinterpreted to translate back to MIDI- I think that makes sense – I’m unfamiliar with M4L, so I’m a little unclear about how to get the MIDI Clip into the GetSelectedNotes API, though.

October 13, 2013 | 4:59 pm

wow, thanks mooter, this was exactly what I was looking for!

How did you figure out the syntax for get_notes? It’s very very different from what’s in the LOM; there’s no specification of get_notes "type" and then it’s double int double int afterwards, it’s weird. :?

In my little patch I’ve done without the jitter matrix, since they’re basically dumping into a matrix and then going straight back out; instead I’ve opted to simply sort them with a coll, but then your little wonder comes along with that nice rounding there, I may stick with this. It looks really slick :)

October 14, 2013 | 8:50 am

Thanks. The syntax was trial and error. Yes the LOM says to use double for all but really for pitch and velocity it’s int. And yes jitter matrix can be overkill for some tasks and I stick to coll when I just need a temp cache. I initially used a coll to dump the notes but then I needed them to be saved with the live set so I replaced it with a dict:) Dict is going to be pretty essential for most of my stuff, I think, while coll is still useful as a temp cache. I really like that you push and pull between the 2.

I’ll be releasing my advanced round robin device soon ("AdRoRob"?) to open up a lot of possibilities using that encapsulation so keep your eyes open!

October 14, 2013 | 2:50 pm

Yeah, looking forward to seeing that! It really helped to crossreference the LOM with your patch… man, this documentation…

the possibilities for my group are pretty immense; this means I can make any clip available over the network. I’ve been pondering this for quite a while.

It also solves a problem of handling polyphonic midi recording and sequencing for me. Doing it in-clip is pretty cool; combining the sequencing madness of max with the easy-in,easy-out of Live is going to be fun.

Viewing 10 posts - 1 through 10 (of 10 total)