Get the name of the clip which is currently playing in arrangement view

hdgmax's icon

Hi. I am in arrangement view and would like to get the name of the currently playing clip of a selected track (in arrangement view) for use in Max. Note: this question is for the clips in arrangement view, not for the clips in session view. Any ideas/solutions?

broc's icon

Not possible since arrangement clips are not part of the Live Object Model.

hdgmax's icon

Thank you BROC. I hope someone of the Max for Live development team reads this and converts this into an official feature request :)

hdgmax's icon

5 years later now. Any solution by now?

Isabel Kaspriskie's icon

There are new Arrangement Clip interactions that are possible as of Live 11. You can read more about it in the Arrangement Clips section of https://cycling74.com/articles/what's-new-in-live-11-part-1.

hdgmax's icon

Thank you for your feedback Isabel. I wil try it out.

hdgmax's icon

I hope I am wrong but after some quick testing it seems the Observer is unable to detect when a new clips begins or ends in a track in arrangement view. So it will require additional programming :(

cracklebox's icon

See my post here:

https://cycling74.com/forums/accessing-arrangement-view-clip-information-performance-issues

cracklebox's icon

It'd be so nice if we could have access to the arrangement view clips as dict- as you guys have done with the notes API update

hdgmax's icon

I also tried getting the current song pos from live observer and then comparing it with the start pos and end pos of all the clips in Arrangement view. But that does not seem to work because getting the current post from live observer takes too much processing, even with a very fast laptop, and does not leave room for other live api action or Ableton actions. Defer low also did not seem to help to reduce the triggers in live observer. I also tried to only temporary getting the current song pos from live observer as follows: every x ms I send a message to live observer to get the current pos, then I quickly get the pos and then I send an another message to the same live observer which does not get that many frequent triggers. But still not really the result I would expect to get.

So if someone of Ableton reads this:
When a song is playing, Ableton knows exactly which new clip start and stop. So can't this kind of info (clip ID start/end) also be put in the live observer of the API, for arrangement view? And then when the live observer would output the ID start/end of the clips then the users can easily extract clip name, clip color, clip start, clip end, ...

I am a bit disappointed that this functionality is not yet available in Live 11.

That would bring sooooo many new programming possibilities for the users. A few examples...
- DMX lights same color as clip color in arrangement view.
- Projecting the playing clip names to a projector
- Creating a dedicated track in arrangement with text for karaoke or with instructions for choir/singer.
- Triggering any other actions when specific clips start or end...relays, UPC messages,...
and many more functionalities I have in mind

cracklebox's icon

I've got it working pretty nicely at the moment. It's part of a much bigger patch and will be a bit of a pain to extract but essentially:

Have live.observer watch all clips on a track. Each time a clip is moved/added/removed live.observer updates. This list is then iterated over and fed into a live.object where I query the clip name, start time and end time. This info gets stored in a dictionary.

I then use the playhead position to query the dictionary to see which clip is currently playing (had to do this bit in JS- couldn't think of a native max way of doing it). Basically:

For loop over the dictionary and then:

If (playheadpos > start time && < endtime) return clip name.

This works pretty well, but I can see it falling apart with this on multiple tracks and 100s of clips.

cracklebox's icon

+1 for an easier approach to getting current playing clip from live.observer though. Been wanting this feature for years. I only really need it for audio clips and have gone down horrible rabbit holes like using the right channel of a stereo file and encoding data in the audio file to get which clip is currently playing...