How can I easily control the next device on a track

Learn about building and using Max for Live devices.
Post Reply
bencodec
Posts: 330
Joined: Fri Jun 11, 2004 5:14 pm
Location: Brooklyn

How can I easily control the next device on a track

Post by bencodec » Tue Mar 23, 2010 7:43 pm

Hey guys, how can I easily have my M4L device control the parameters of the next device after it on a track. I know i can get the parent, can I then get the id of my device and then add 1? Is there an easy way for a device to get it's own id?
I'd like all this to be relative so that I can quickly swap out the device after my patch and have the controls remap.
thanks
Macbook Pro unibody 2.2 Ghz Quad i7, 16GB RAM, 512MB graphics, 500 GB SSD, 500 GB HD, Mac OS 10.8
http://www.bangbang-nyc.com

S4racen
Posts: 5987
Joined: Fri Aug 24, 2007 4:08 pm
Location: Dunstable
Contact:

Re: How can I easily control the next device on a track

Post by S4racen » Tue Mar 23, 2010 8:44 pm

Hi mate, you might want to carve this out of my isotonik patch, if you download it from max4live.com and hit me up i'll point you to the part you want....

What i've done is give the ability to take control of the 3 devices after the max device and swap in between them by hitting some buttons, i have problems with bleeding values when doing it live though so maybe you can help me with it once you've pulled the parts you want out....

Cheers
D

hyaahyaa
Posts: 21
Joined: Thu Oct 22, 2009 2:35 am

Re: How can I easily control the next device on a track

Post by hyaahyaa » Tue Mar 23, 2010 9:24 pm

ID numbers are not ordered in a sensible way - they're actually assigned in the order the API needs them (as far as I can tell).

What you want to do is send "path this_device" to a live.path, input that ID number into a live.object, then send "getpath" to that live.object. This will give you the canonical path of your device (path live_set tracks X devices Y). You can then add/subtract from Y to get neighboring devices, and send that path to another live.path to get the id.

<pre><code>
----------begin_max5_patcher----------
548.3ocwV1saaBCE.9Z3ovx2trH+ClP2cquFUUUTvKwafIJ3zksp9tO7ARax
JjXnMNJBHbrw9iONGCOGFferZmrFi9F5NTPvygAAPHafftyCvko6xJRqgtgK
k00oKk3YssYj6LPbUNhsOX0VSgzX9yZY6Hiwn66Z5GUZSs5uPCTxbRW30olr
UJ8xG1HyLsWDiXaFwhfCBXOMdN40gRusToalGfKVWPUNPS0i+7qzD7ASpNsD
lT722nRKP2VUjieafZIFFIpM3Kgg1cybTJZ4ualw24j0oY+BUC+H1sKgenIQ
1CIwyE1SFxOw83m3qse9BhNnRTZyjrxBVahBHGN6zVourF901Ja0tm2L6sMq
vN3u86NlKYTrD3.YAT+QFRdzdjmXX40u2h+77Vg5I47laqUmWWSWNLBHGgX7
tIZrtg+I6llFr2NibQHWrxMfThiNsT5qZiNVoLkBsgdm0Ro4z4KS2HwsoIz1
knGiQH9vHWyRH9Tqf39n.ZnbEqUPlUp5GxkOoxjWhjFPL2rXz4LhORJCLKMO
40++2ABbZierspq1tIa+M69E1PzWgMWVaT5TipReXmRNpSqT44Rn88VoTkut
p4EWcPftu2mcNyTy21fHmioni5zEmIgKLE6elntvD0uLwbgIleYh6BSb+xTj
KLE4Ol3tliK7GSTWXR3+5Nw4Xh6UlbY4I+Rj8agN+SNpWYh6xBlTutfoSHQ9
.Vp4jWB+GniMkvF
-----------end_max5_patcher-----------
</code></pre>

bencodec
Posts: 330
Joined: Fri Jun 11, 2004 5:14 pm
Location: Brooklyn

Re: How can I easily control the next device on a track

Post by bencodec » Tue Mar 23, 2010 10:30 pm

you both are AMAZING! thanks!
Macbook Pro unibody 2.2 Ghz Quad i7, 16GB RAM, 512MB graphics, 500 GB SSD, 500 GB HD, Mac OS 10.8
http://www.bangbang-nyc.com

Post Reply