need help - calling get_notes on a clip
i’ve enclosed a screenshot of my attempt to get MIDI data from a clip - adapted from Live Abstraction FireSelectedClip
gives me syntax error.
what am i doing wrong ? this excerpt was actually copied/modified from the M4L.api.FireSelectedClip code snippet that Cycling74 provide.
if i simply replace the "call get_notes" with ( original ) "call fire" message the selected clip fires ( gets launched ) correctly. So the path to the clip is correct.
i thought of using the get_selected_notes but thats really for when one wants to modify the clip notes themselves etc. in a clip view. I need to be able to get the note content regardless of whether the clip is being viewed or not. And i've looked t the built-in example snippet which does that sort of thing and sticks it into a jitter matrix. ( not what i need )
I want the ENTIRE collection of MIDI notes and the manual seems to indicate that the get_notes function operates exactly the same as get_selected_notes but gets ALL the notes. Which is what I want.
There's maybe another way to do this. Notes are taken from whatever clip is playing.
Notes are seen in the max window from a print message.
Format is: pitch start_time duration velocity muted
@see https://docs.cycling74.com/max7/vignettes/live_object_model
@see http://compusition.com/writings/js-live-api-midi-clips-reading
Hope it's useful :)
Michael Gary Dean
https://michaelgarydean.com
Heey!
How I use this in a max for live midi device? Or how do I initialize this? I'm trying to use it in a M4l midi device and I'm getting this error messages:
live.object: get: no valid object set
live.object: call get_notes 0 0 0 128: no valid object set
Do I need to change some name, number or id?
Thanks!
[p playing_slot_index] will return -1 if there isn't a clip playing on the track the device is on. Try loading up a test clip and playing it.
Hope it helps!
Michael Gary Dean
https://michaelgarydean.com
Aaaaah ok... it works with session view only... I was trying with midi clips but in arrangement view.
It's a great patch! Thanks for sharing
Any advice or clue on how to make it work in Arrangement view? And make it read different midi clips arranged consecutively in a MIDI track?
Now that I think about it, it must be harder than I expected hahaha
Should work for arrangement view as well, but you'll have to identify the clip in a different way than is done with [p playing_slot_index].
The Live Object Model has a function for the Track object called "arrangement_clips" which is "The list of this track's Arrangement View clip IDs".
Then I would try something from the Clip object to identify it from the list. Maybe the "is_playing" function?
Reference:
https://docs.cycling74.com/max8/vignettes/live_object_model
Michael Gary Dean
https://michaelgarydean.com
Thanks for the advice!
I will check the information and share any progress I manage to achieve.