Check if an ID still exists without generating a Max Console error?
Hi All.
I searched quite a bit to see if someone had a solution for this but I couldn't find anything.
I have a device that gathers data from clips in the Arrangment view of Ableton Live including the clip id and populates them into a dict.
When a clip is deleted from the Arrangment by the user I'm trying to also remove it's corresponding entry in the dict automatically. I was planning on scanning the dict and periodically checking each id listed in the dict to see if they still exist. id's that don't exist anymore would be removed.
If I use live.observer or live.object to look for an id I can tell if it exists or not. The issue I'm having is that it generates a Max Console error saying that it's an invalid id. If I do this regularly the console will be full of errors.
Is there a way to check if an id exist and not generate a max console error?
Thanks for your ideas in advance :)
I don't think it's possible.
But deleting a clip could be done with a 'delete_clip' message
(using 'live_set view selected_track' and live_set view detail_clip').
Then you have the clip id and can remove it from the dict.
I kind of figured that was the case. I've started to re-think how to get the data to be removed from the dict or Coll instead of checking if the id exists. Thanks for the idea with the delete_clip message, that might be useful when I'm deep in the rabbit hole.
*edit
I didn’t read your response correctly. I already have all of the clip id’s in the dict FYI. I’m just trying to make it go away when the clip goes away. I can do that by checking for the id and if it doesn‘t exist delete the corresponding entry, but I get a Max console error. It works but it’s not clean.
I’m working on a device that uses the names of clips to trigger midi program change messages. It also sends those changes slightly ahead of the actually start time of the clip in the arrangement. It’s working but I’m trying to deal with data management so I don’t get messages being sent for clips that no longer exist.
Oh, and thanks for all your help in general. You pop up with solutions in a lot of my searching and I finally get a chance to thank you for that <3 :)