Detect changes to track count or track focus?

Learn about building and using Max for Live devices.
Post Reply
hacktheplanet
Posts: 2846
Joined: Sat Sep 25, 2004 6:37 am
Location: Chicago, IL
Contact:

Detect changes to track count or track focus?

Post by hacktheplanet » Fri Dec 26, 2014 10:25 pm

I'm writing a device that routes values from the Live API from audio tracks, and then sends them to a MIDI channel... Like control states and other UI stuff. It is so I can do custom stuff on my controller.

I have some dropdown menus that are used to select a Live track. I'm populating these dropdowns by getting a list of all track IDs in the set, and using those to grab the names. It works quite well, though it must be updated manually with a bang.

Can the Live Observer detect when the quantity of tracks in a project changes, or when focus is drawn away from the current track? That would be ideal. (Otherwise I guess I could just bang every 10 ms to update the dropdown.)
Image

Valiumdupeuple
Posts: 1135
Joined: Mon May 31, 2010 12:36 pm
Contact:

Re: Detect changes to track count or track focus?

Post by Valiumdupeuple » Sat Dec 27, 2014 12:16 am

Observe the selected track's id.
( live.path live_set view selected_track )
put a deferlow if you get the "can't triggered by notification" error message at some point.

hacktheplanet
Posts: 2846
Joined: Sat Sep 25, 2004 6:37 am
Location: Chicago, IL
Contact:

Re: Detect changes to track count or track focus?

Post by hacktheplanet » Sat Dec 27, 2014 2:13 am

Valiumdupeuple wrote:Observe the selected track's id.
( live.path live_set view selected_track )
put a deferlow if you get the "can't triggered by notification" error message at some point.
I cannot believe I missed that in the API. :D thank you!
Image

Post Reply