Issue with Open GL context name and initiation of device in Ableton Live
Hi! I am creating a series of M4L devices that use the same open gl context name. The context name is made out of the track id where the devices are sitting. I have a device that I call "source" which is the one with the jit.world, and when I place this device alone in a track in Ableton, the jit.world window have the name of the context correct, and when I add the other devices to the same track, they all project into the same jit.world window. The problem comes when I close ableton project and open it again, then the jit.world window have a u<random number> type of name. I delete the other devices and the problem is solved. I can´t figure out why that is happening. I attached the source device and the other 2 devices patch.
Sadly I couldn't reproduce. I exported the source patch and one of the two others as M4L devices, put them in a Live set. Name of source jit.world matches drawto of gl objects in the other module, all fine. I save the Live set, close and re-open, and name and drawto are still correctly set.
Maybe it has something to do with the ordering of your devices in the track, and/or order of execution in general.
A few things to try (these are just wild guess intuitions):
put your source device all the way to the left in your track devices? at least left from your other video M4L devices
enable jit.world only after its name has been set
I doubt the following will have any effect, but just in case: in the two other modules, add an extra delay to set the drawto's (make sure that the jit.world is named and running before setting the drawto of other objects)
Thanks for your reply. In my case, it works fine randomly. It works when I delete the devices and place them again in the track. Could you explain how to "enable jit.world only after its name has been set"? I guess there´s something going on related to that because, sometimes when I load the project, the first thing that appears is the jit.world window and the name on top of it is first is u<random number> and then, when the project load completely, is gl_(track id).
I am also confuse with the use of deferlow: in the max documentation is advice to use it in between live.path and live.objects, but in this device I am developing, I think is convenient that certain messages get read first than others, like the jit.wortld name, for example.
Also, I am starting to use jit.pworld to test each module device individually inside the patch area, so I don´t have to close the patch and try in ableton live. I can't tell if it is a problem when I use jit.world in the source device and I also use jit.pworld in the other devices, and all of them have the same name context.
Sorry for the mess, I just want to figure out the source of the issue on my devices :)
Could you explain how to "enable jit.world only after its name has been set"?
Remove "@enable 1" from your [jit.world], and use [trigger] to sequence messages in the order you want. Something like [t b i] will first send the received integer to its right outlet (use it to set the world name), then the bang will be out from the left outlet (use that to send a "enable 1" message to your world). In Max (and programming in general), messages never happen at the same time, they always come one after the other. [trigger] (shortcut as [t]) is your best friend to ensure messages come in the desired order.