Observe property changes inside the drum rack/chains

20 views Asked by At

Is it possible to monitor property changes of all devices within a drum rack/chains? Properties such as: samples, chain name, file path, drum pad names...

The problem is that in my case I only get a response when I change the last device in the chain, and not all at once.

I start with canonical_parent, find the Drum Rack device and go down to chains - name, where I try to track changes in chain names, or sample - file_path within them, but only get a response from the outermost devices/chains.

1

There are 1 answers

0
Mattijs On

Currently, the only realistic way to get updates of a dynamic amount of properties is to use Javascript in Max.

For every property you want to observe, you need to create a LiveAPI object with a callback property, for example like this:

rackDeviceView = new LiveAPI(rackDeviceCallback, rackDevice.unquotedpath + " view")
rackDeviceView.property = "selected_chain"

function rackDeviceCallback(args) {
    if (args[0] == "selected_chain") post("selected_chain changed\n")
}

There is one pitfall though: at the time of this writing there is no way to unregister an observing LiveAPI object. So if you create new ones often, Live may at some point start to become sluggish.