Observing clip's playing status in the arrangement view?

Apr 27, 2012 at 10:31pm

Observing clip's playing status in the arrangement view?

Hello,

it looks like when I play an arrangement in Live, the playing status of the clips is not updated.

In fact if I look at the session view, all the clips are off even though they are actually playing in the arrangement view. (or maybe they are two different things and I don’t know enough about Live’s internal architecture)

My question is, is it possible to retrieve the playing status of the clips in the arrangement view (actually I need the name of the playing clip, but I already did that and it works fine when just using the session view for launching clips).

I tried to look in the Live Object Model Reference but couldn’t find anything useful..

Or can you suggest a clever workaround?

Thanks a lot for your time and help!

best
Pedro

#63266
Apr 28, 2012 at 1:13am

Clips in the arrangement are not objects that can be handled with the Live API.

#228241
Apr 28, 2012 at 9:30am

Damn… as I thought :(

Thanks for the reply broc

I am trying to think of a workaround for this..

What if there is a MIDI note at the very beginning of each clip?
This way when I play the arrangement the MIDI notes should be sent out each time a new clip starts, right?
Do you think it would be possible in m4l to listen to all the MIDI notes coming from the arrangement and understand from which clip the note is coming? (and therefore find out the name of the source clip?)

Or do you have other ideas?
Many many thanks

#228242
Apr 28, 2012 at 12:02pm

Yes, in theory you could have a midi note or another midi event (cc, program change) at the beginning of each clip and use a simple M4L device on each track listening to that event. If the same clips are also stored in session view on the same tracks, the event value could be used as slot index to retrieve the name from the clip.

#228243
Apr 28, 2012 at 12:24pm

Ok, but how can I tell from which clip on the track the midi event is coming from?
The event value could be used as slot index to retrieve the name from the clip? How?
Thanks broc!

#228244
Apr 28, 2012 at 12:30pm

Well, each clip needs to have a different event, for example using CC with values from 0..127.

#228245
Apr 28, 2012 at 12:38pm

hmm unfortunately this isn’t really a solution for me, I need something automatic and not manual..

so if it’s not possible to check the source clip of a midi event on a track, maybe one solution would be creating a device that automatically populates a clip with midi events according to the clip’s name..or maybe according to the slot index, even though I want to be free to move clips around in my session view..

#228246
Apr 28, 2012 at 12:43pm

..but I’m not sure it’s possible to add midi events to a clip via m4l? Looking at the LOM right now, only possibility I see is a combination of select_all_notes – replace_selected_notes functions? what do you think?

#228247
Apr 28, 2012 at 1:21pm

To add midi notes to a clip, the combination is: deselect_all_notes – replace_selected_notes.

Unfortunately it works for notes only, but no other midi events.

#228248
Apr 28, 2012 at 7:27pm

Oh you mean that when no note is selected the replace_selected_notes creates a new note? This is not clear in the LOM Reference, thanks a lot broc I will try it

#228249
Apr 28, 2012 at 7:41pm

oops sorry it’s actually written there..

deselect_all_notes Call this before replace_selected_notes if you just want to add some notes.

thanks!

#228250
Apr 28, 2012 at 11:27pm

Just to let you know, note creation works fine and now I’m patching a little converter that allows me to translate the unique id of the clip to a midi note (pitch+velocity, so 128×128 resolution, should be enough)

sounds like a good workaround :)

thanks again for your precious help

#228251
Apr 30, 2012 at 10:14am

Did that and it worked..
however I realized that if I save and close a Live set, when I reopen it the system won’t work since the id of the clips are not stored..

plus the documentation says that “The id is only valid inside the device with the live.path and remains unchanged as long the object exists.”..
what happen if I have two instances of the same max devices on two different tracks? will the ids be the same in the two devices? It looks so to me, but I’d like t be sure of this before I proceed further..

now I’m trying to find a way to check all the existing clips when the device is reloaded (ie on startup) and re-assign midi notes accordingly to the new ids..
possible? any hints?

thank you

#228252
Apr 30, 2012 at 12:34pm

Checking and modifying all existing clips can certainly be done by iterating over all tracks and clip slots.

But there is another serious problem: the arrangement clips are independent copies of the session clips, meaning that any changes of the session clips are not reflected automatically in the arrangement clips. So you would have to move the clips manually from session to arrangement after each restart.

I forgot to mention that there is a special case to access clips directly in arrangement view with the Live API, namely by selecting the clip and using the path ‘live_set view detail_clip’. This way you can perform some operations on arrangement clips, but unfortunately the clip selection cannot be automated.

In summary it seems to me that a perfectly automated solution of your problem is not possible.

#228253
Apr 30, 2012 at 3:14pm

Damn you’re right.. well in this case there is only one option left:

at the moment I am converting the id of the clip to a midi note, problem is that the id changes everytime the device is reloaded.

I will convert the entire name of the clip to a combination of multiple midi notes, this way I will be sure that even if I close and reopen Live everything will stay the same.. correct? would like to hear your thoughts on this one

thanks for pointing out the ‘live_set view detail_clip’ too, didn’t spot it in the LOM..not what I need in this case but can be handy in the future :)

many thanks broc

#228254
Apr 30, 2012 at 5:19pm

Yes, using the clip name in coded form (eg. ascii) is probably the best solution!

But I’m still not sure how the pseudo notes can be separated safely from real notes.

#228255
May 1, 2012 at 10:06am

Well these clips will not contain real notes..they will be used just to trigger different scenes (presets) of an external music visualization software..

So basically I use a umenu to browse the folder where all these presets are saved, select one and assign it to the selected clip..
So yeah, name looked like the best solution, but I realized that there would be a conflict if there are two presets with the same name in two different subfolders..

So I thought that the best would be to read the creation date of the preset file.. I checked the node called filedate, but it only gives the modification date which is not what I need..

I know it’s a bit off topic, but do you have any idea on how to access the creation date of a file? Found this topic http://cycling74.com/forums/topic.php?id=35487 but it looks like mac only and I’m using windows..tried to search on maxobjects.com too..

thanks!

#228256

You must be logged in to reply to this topic.