Stepping through a MIDI Clip with m4l

Oct 10, 2013 at 10:21am

Stepping through a MIDI Clip with m4l

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?

#267700
Oct 10, 2013 at 10:21am

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

#267701
Oct 12, 2013 at 2:36pm

No one has tried to do this?

#267876
Oct 12, 2013 at 5:17pm

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

#267879
Oct 13, 2013 at 2:52am

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.

#267901
Oct 13, 2013 at 5:41am

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

Here’s a straight copy from my “extract” encapsulation:

<code>

– Pasted Max Patch, click to expand. –

</code>

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!

#267911
Oct 13, 2013 at 10:47am

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.

#267935
Oct 13, 2013 at 4:59pm

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 :)

#267953
Oct 14, 2013 at 8:50am

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!

#268023
Oct 14, 2013 at 2:50pm

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.

#268057

You must be logged in to reply to this topic.