[live.path live_set view selected_parameter] outputs 2 ids for m4l device params

to_the_sun's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Any ideas why a [live.path live_set view selected_parameter] would immediately send out 2 ids when a parameter is selected? It only happens for params in m4l devices and i feel like it has something to do with how live.remote~ (which is where these ids are destined) leaves m4l params clickable after taking control of them, unlike other params. It seems to send out the correct id right after the id of whatever was last selected in that device. I had to throw together this jank to deal with it

broc's icon

Just did a quick test connecting 'print' to the output.

I've loaded 2 M4L devices, device1 containing parameter A and device2 containing parameter B. Now, selecting A gives me a single id (58) and then selecting B also gives a single id (59). And switching between A and B always outputs a single id.

However, if B is selected after A and I click somewhere in device1 (thus de-selecting B), it outputs 2 ids, namely id 58 and id 0. So device1 seems to remember that parameter A was previously selected. But the output behaviour is strange and may even be considered a bug.

Note that my test doesn't involve live.remote~.

to_the_sun's icon

Well I assume it's the correct function of the object to output id 0 when something is de-selected. That happens for me also, outside of Max for Live devices, and doesn't cause me any problems. Inside M4L devices however the behaviour is different. Say the live.path is in device 1, and both parameters are in device 2. Selecting A would produce id 59 followed immediately by id 58 if parameter B was the previously selected parameter in that device (and I don't even mean immediately previously selected; it happens even if there's nothing actually selected in the device). If parameter A is the previously selected parameter and is selected again, then I'd get id 0 followed immediately by id 58.

There's a whole lot of code between the live.path and the live.remote~ though that could be causing this, I just can't imagine how.

broc's icon

I can reproduce what you described for 2 parameters in a device, getting the ids of both together.

For testing I've used a minimal setup. [live.path live_set view selected_parameter] connected only to print, and the device contains just 2 live.dials unconnected. So the strange behaviour seems definitely not related to live.remote~.

to_the_sun's icon

hmm weird. So i'm not just crazy at least..