Live API correct path

Mariano Sibilia's icon

Hey everyone!

I've been working on a m4l audio utility device aimed at controlling specific parameters of an Ableton instrument (Simpler).

Right now, I've got this pathway going: "path this_device canonical_parent devices 0" and has been working fine until I introduce one or more MIDI devices before the Simpler (like Scale, Velocity, or Pitch). As according to the path, the device will always take info from the first device in the chain...

I was wondering how to correct the path or if there's an entirely different approach that would allow me to control the leftmost device relative to my m4l device. This way, it will always work regardless of the devices placed before Simpler or the number of tracks etc..

Big thanks in advance!
M

Source Audio's icon

you could list all devices in a track, select one less than your device from the list. which shoud be one left to it.
or if you want to select simper, than look for it

Mariano Sibilia's icon

thanks so much for your response! that's really interesting. if i copy the example you sent i can see the id of the simpler device in the message box but can't make it to work in controlling the actual simpler device.

normally, i would put message box for calling actions (like "set ... $1") into the live.object after setting up the appropriate path... btw, i'm still pretty new to this live api, so i hope you don't mind my learning curve on this :)

Source Audio's icon

something like this ?
I don't use live at all, and can't test it, but that should work.

Mariano Sibilia's icon

that seems to be working! amazing. thank you soo much! although i need to go to some functions down a level inside the simpler - this is my usual path : path this_device canonical_parent devices 0 sample

Source Audio's icon

you have to use device number of simpler to get sample id

path this_device canonical_parent devices $1 sample

if it is not 0 then you get id 0 or nothing

something like this (you need to test it)

on the right, device number / id pairs get stored into coll,
and simpler id recalls it's device number

Mariano Sibilia's icon

Thank you so much, you're a genius! :) That was super clear and helpful - much appreciated!