Accessing arrangement view clip information: Performance issues.
Hi all!
So it's great that we now have access to arrangement view clips in M4L, have wanted this for a long time!
What I'm trying to do is have my M4L device report what audio clip is playing on an audio track at any given time. This was fairly easy to put together:
I'm getting a list of arrangement view clip ids, getting the clip name, start time and end time, storing this info in a dict and then querying the start time and end time using the playhead position. So far, all good.
However, I'm running into serious performance issues when I have more than a handful of clips on a track.
I've isolated the issue to querying the live.object, it seems insanely slow and was wondering if anybody had any ideas for optimising the performance here. I.e when I've got ~100 clips on a track it can take > 1 sec to iterate through all the clips and retrieve the data.
I've attached the offending part of my patch (frozen with JS) - it also includes a timer which reports how it has taken to iterate through all the clips. Should be pretty easy to follow.
Thanks in advance for any suggestions!
The issue is probably due to the fact that start/end time of arrangement clips are not immanent clip properties (as with session clips) but must be calculated from the actual layout. So the user can't do anything to improve the performance.
Interesting, thanks. I'll have a play without grabbing the start time and end times to see how that affects performance. Although to achieve what I want I'll need to be accessing that info somehow!
C74 folk - It'd be so nice to have a live.observer report 'current clip name' on N track from the arrangement view!
Hey @Cracklebox
Did you progress in this?
I'm working on a functionality in the same ballpark: I want to be able to observe/monitor if any clip is playing on a track in arrangement, and then map that to an arbitrary target in live (mainly a mute button in my personal case)
(i.e. observe if the playhead/transport is currently playing/moving through any clip on a specified track)
I tried this but it doesn't work in arrangement view AFAIK - i tried in session and it worked.
Maybe a workaround, is getting the start and end time, of next arrangement clip coming up. Then activate when transport is in that range. But it also seems a bit in efficient? hehe :)
Did they answer you? Regarding the LOM?
Best,
Jarl 〜( ̄△ ̄〜)