Forums > Max For Live

observing track paths or ids better?

Sep 24 2013 | 3:07 pm


Im trying to figure out the best method to observe added/deleted tracks and clips within the tracks in liveapi. Observe the path, or ID.

If I observe the path and a track gets deleted, another track will take that path and therefore will not be observed? I may have to re-observe all tracks, which is an overhead I would like to avoid.

If I observe the ID of the track, if a track gets deleted, I can just dump the observer and all the other tracks will still be observed. However, I have had some problems/strangeness observing IDs.

Would be grateful if anyone could shed some light on this.

Sep 24 2013 | 5:15 pm

I think the left outlet of live.path gives the object ID which remains the same if other objects are added or deleted. Can you describe a specific situation where you have problems with observing IDs?

Sep 24 2013 | 6:23 pm

Jeremy mentions in the post beneath to use the persistent ID feature, because it seems IDs are not persistent? I dont know how, but im not comfortable with it yet. Can anyone explain what a persistent ID is? Does it come out of the left outlet of live.path, or the right outlet? For instance how does that work in JS without the object to click the "persistent mapping feature"?
So I have been using caution when using IDs and opting to use paths instead.

What I really want to do, is to observe all clips in each track separately, rather than having to refresh all tracks (when only one thing changes, such as renaming a clip, or moving a clip)

But when observing tracks, it seems that once a track is deleted that contains a certain path "live_set tracks 1" another track will take the place of that path, but it wont be observed. When taking into account groups etc. it seems difficult to know what the arrangement of the observed tracks is going to be, so it makes most sense to start observing all tracks again – with a massive hit to performance (if you have a lot of clips/tracks).

By observing the ID, it seems that you can create observers for that specific track/id. If a new track is added/deleted into a bunch of other tracks, it doesnt matter so much, because you can just call the new track ID, observer that, and then all the other tracks will continue to be observed.

Im just really trying to check whether using IDs to observe tracks is the right way to go and whether I need to figure out this persistent ID feature.

Viewing 3 posts - 1 through 3 (of 3 total)

Forums > Max For Live