How can I tell max when a live clip has finished playing?

[ C W M ]'s icon

I'm having difficulty deciphering the documentation. It looks like I need to use live.observe but I have no idea how to tell it to observe the specific clip and then how to get the info as to when it stops playing. The help files are no help. Please help! :)

protocol's icon

same device as the last answer I sent:
live.observe the property "playing_slot_index" from the track. It will send -1 for no clip playing, and 0 to infinity to the scene number its playing.
I am pretty sure it also tells you launched clips as well.

ShelLuser's icon

Keep in mind that M4L knows 2 kinds of help. You have the reference pages which basically tell you all about the object and a very small example. And you have the help patches (alt-click on an object). That gets you a working demo patch which you can even unlock and copy/paste stuff from.

Max Patch
Copy patch and select New From Clipboard in Max.

Alas, having said that; here's a demo patch. It listens on track 1 for a clip to play and will print out the status (see Max window or Max runtime window).