send/receive to a specific device in Ableton

Marc Assenmacher's icon

Am am sending data from one device to multiple different devices in Ableton.

The sender device has a send object and every receiver device has an receive object coupled with a gate.
To select the receiving device I compare the current selected tracks id with the devices track id. If they match I open the gate, if they don't I close the gate.

It seems Ableton prioritizes devices in the current selected track and afterwards works through changes in other devices. Because of that, when changing the current selected track, I have a short time when gates are opened in two devices at the same time and data gets messed up.

I tried many different approaches like delayed banging etc. but nothing seems to work.

The only solution I can think of is specifically sending the data just to the device on the current selected track by id or something else.

Is there a way to approach that? Or does someone know another approach to try?

------

For anyone interest, here are my test devices. They contain some more unrelated stuff though.

Test - Receiving Device.amxd
amxd 45.83 KB

Test - Sending Device.amxd
amxd 241.11 KB

tyler mazaika's icon

send/receive can use the "---" prefix to the names (e.g. [receive ---MyDevice]) if you want to send to specific device. (And use [forward] instead of [send] if you need to change targets).

If you go that route you just need a way to share among all your devices that unique target name. I've done this in the past by making a [dict] for the whole class of related devices that each device can write into. Structured something like this:

{
"023MyDevice" : {
"id" : "id 78",
"unique_key" : "023",
"parent_track_id" : "id 4"
"receive_address" : "023ReceiveName"
},
"024MyDevice" : …
}

But also, maybe to solve your problem you can just observe the selected_track in each device instead of only in your "brain" device? Send/Receive timing between devices always indeterminate.

double_UG's icon

prepend then send ID to your message and receive it with route.

Max Patch
Copy patch and select New From Clipboard in Max.

Marc Assenmacher's icon

@TYLER MAZAIKA:

I know that I can use send/receive prefixes, but how do I get the prefix ids when I add devices in Ableton on the fly? Is there a way to retrieve the prefix ID after adding a device to a track? That would solve my problem!

I haven't used the forward object yet, but it seems suitable!

When I observe the selected track in every device the timing gets out of hand even more. I had it that way initially. In the end I will have about 60-80 receiver devices, so I though at least staring the process from one device will be more accurate than from 60-80 different devices. But it did not help to much.

@Double_UG:
This is a nice approach as well! But in the end I will send to all devices at the same time and filter out a the receiving end again. I think this will work but Tylers approach seems to be more performant to me.

Still I will try both ways and see which one works best! Thanks for the helps so far.

Marc Assenmacher's icon

Ok, I implemented @TYLER MAZAIKA solution with send and forward and simply used the track id plus the tab number as unique id. This simplified my patches by an enormes amount, since I was able to solve two problems in one go. Simply amazing!

For reference:

Test - Receiving Device.amxd
amxd 40.11 KB

Test - Sending Device.amxd
amxd 238.10 KB

tyler mazaika's icon

Cool, I'm glad that worked for you. re: "Is there a way to retrieve the prefix ID after adding a device to a track?"

Max Patch
Copy patch and select New From Clipboard in Max.

Note that using the --- value may be more beneficial later if you need to be able to move your receiver devices around (in which case the track id may become invalid?). But with that many receiver devices I'm gonna assume that there is one very particular way this will get set up :)

Marc Assenmacher's icon

Oh wow. I never knew that --- is also replaces with a unique ID in messages. I though this is limited to send/receive objects only. Is there any documentation regarding --- ? I never found one.

I made the patches about purely for the purpose of testing. I my end product there will be some additions and changes. But there will only every be one receiver device per track, so the track ID is suitable in my case.

Thanks regardless for your help and efforts. It helped a lot and will help me for future patching!

ecuk's icon

On the use of three dashes (---) to generate unique IDs, there is (rather well-hidden) documentation for Max near the end of https://docs.cycling74.com/max8/vignettes/dollar_sign_and_pound_sign and for Max for Live at https://docs.cycling74.com/max8/vignettes/live_symbols.