Comment 8 for bug 1131460

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

Yea -- that's right. You can both receive and write MIDI messages from virtual MIDI devices. It works just fine and there are a number of presets that do that today.

Unfortunately, the way Mixxx's scripting system is designed every MIDI device has an isolated Javascript engine dedicated to it. This enables things like loading the same preset to multiple devices. If you have two SCS3d's then you can load the same preset to both of them and the script does not get confused about which one it is talking to because they are both totally isolated from each other.

This is for UI reasons as well -- the user needs to pick which device they want to load a preset to in the preferences. It would be a little confusing if you just loaded the SCS3d preset without specifying a device to load it to. Especially given that if you have 2 then you need some way for two separate instances of the SCS3d preset to be loaded and attach the two to different SCS3d's somehow.

I think it's unlikely we'll get to the point where single script environment can address multiple devices. It would take a lot of work at least. A hack /could/ be made... especially since as of Mixxx 1.11.0 devices are all in the same controller thread now (this was not the case in earlier versions of Mixxx).

One thing we do have plans for is to allow scripts to communicate with each other either via message passing or using the control system to create common shared controls they can pass values through. This way you could create a preset that attaches to a physical device and then send messages to a preset that controls a virtual MIDI device to have that virtual MIDI device send out a message that does something in the real world (controls a light, moves a motor, etc.).

I realize it would be really nice for tinkerers to use our MIDI script environment if it was easy to address multiple devices but really that's not what this system was designed for (nor is it really the use case it's intended for... it's main purpose is just to facilitate communication between Mixxx and a device).

Maybe this would fit better in the context of a general scripting system for Mixxx -- one that isn't associated with a particular MIDI device.