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?
Preferably not reprogramming the MIDI with the live.step abstraction.
No one has tried to do this?
Do you mean cycle through the notes like round robin? Because I’m just tidying up a device that’s about to be released.
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.
Yeah I used the get note, but within the boundaries of Live’s clip loop.
Here’s a straight copy from my "extract" encapsulation:
----------begin_max5_patcher---------- 2411.3oc2bs0aaibE9Yu.6+gAB9gcW3nN23sBTfzM8k7PVTztnujFHPQNwdR oHUIocr2E8+dmKjxRNVjGKwgjdsgsj30y7MemybtQ86e+2cwh0E2KpVf9ynO ht3heWskKLaSukKZ2vEK1DeeRVbk4.WjK9Zw5ur3pl8UKtu1r8eKaYlHe212 FWmbiL+5UkhjZ6cfyIK8U+34eEJfDrz6JDKXI9JDIbIF8o1y7yE40UxeSnOI BVs+lsme6FYdln1HFz1sVbasZa0OrUXuIKVbk5uGuZpyxdHGdZ5aRd7FyIs3 mk0U0kh3Mn+knLF8Oiyq1MNjolCQMjeC2egYi+uu+6zupd4Jvn1FQUU70huE 1tVT+eDOT0Itg81gadggZDyCavM+gD2NFlQNKLid5X1wXZUn27l2TI9uuq31 7ZvDNKUK3TIbjmGbvmE3PFdvoFI0+1ErP4QFnfFpUA49mKh7MTIodZ4fWNF2 hcNvGya3gu+9+38+xu1E3Ep3TJ7xOhoegimQzIG.G0EUOrYcQVWHhmYPh78L pVdACNcxQVlvNvZdRlHtDrsbOipGy6Uhsbl+vSvTdMTkISDHBDJFCqsX4a9. kbT.iMFNM7WKkwYOGL4.TpTIMBTbZ5uV.AlvbMLEDMqgIBd3woskhsh7TTkn a+BnrcJg9AgmEXMXlsNJPE4DstuTHyAiQJGFzdJvm0Dp.23cN5RPllBIFHxt 5WzPBQ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AiL9lWIvRTId ZDLBHN135.KA1R3ieTRjfYpcLiEJOPtIRFeAi2qfQlFDiAxMwI.w504BZ3zf XDPtINxHFnHw4iuaODPo32TRR53KX8iXzoAwnfVqbBPrdMWPBlFDiOGWRhAg 76SlFAqeuK3Sif0K4mLABFrfQl.+wf4oXDehjr9s8OEXFLmXmBSFDe34TeJD MBLTajc+Al+O5uNxFeTatFuDFlIsIHnbLHLKJZhjLf0UZjUAv34YSq.Tvl.M SPx03m2SXFLNufea5iz3sauS24o1KsUjVrI9K19e09.CrXiL29YaGztnTbmr 8Trs58h3xjaj0hj5aKssU681u+qL2P0+9+zZUrT. -----------end_max5_patcher-----------
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!
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.
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 :)
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!
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.