QSYS and Mosaic integration

I posted this a while ago asking about this, and have been tinkering with the script for a while. It seems to work pretty well.

The Setup:

QSYS is an Audio and Control platform for permanent installations. They use user friendly blocks for compiling the design of Audio, and control logic.

They also have a series of Lua scripting components for interfacing with third party systems like Mosaic. I personally use their Block Controller to program, since I'm still not super confident with Lua scripting. But working with blocks in QSYS has helped teach me some basics of scripting with Lua, to the point I was able to really integrate Mosaic with QSYS, to the point that I have Mosaic button Stations, and the Mosaic will not actually take any action on it's own without QSYS running, because Mosaic always sends the button pressed to QSYS first, and then it parses what command to send in Mosaic.

The Script:

So the main goal I had for my scripting was to have Qsys ask Mosaic for information about what Timelines, Scenes, and Groups were programmed on the Mosaic so QSYS could then update what commands it could send.

The Main Loop of the Script reacts when Mosaic receives the UDP string, "QSYSGET" from the QSYS. it then runs a loop from 1 to 300 (which can be adjusted as a variable in the script) checking each timeline for data: (if tl ~= nil then) it will then Store the Name and Number for the Timeline to an Array.

We then repeat this process for Scenes and Groups.

After populating Arrays with the Timeline Name and then Number as the next slot, the Script then Iterates through each array, appending the items in the array to a String that Mosaic then Returns to QSYS.

So if you had Timelines : 1, Amazing Show! 2 Preshow and 9 Curtain Call then it would send to QSYS:

"Times Amazing Show!,1,Preshow,2,Curtain Call,9,"

Which Qsys will then save on its end. That script can then write a Drop down menu with the Timeline Names, and when you select a timeline it will then send a message to Mosaic to run that Timeline by using the Number, such as sending a string like: "Timeline 009" to trigger this Curtain Call Timeline. There's plenty More Qsys can do on it's end, like setting Scenes, providing manual color sets for groups, tying in lighting changes with the other system automation, etc.

If Qsys restarts, the script will send that "QSYSGET" string to Mosaic, to ask for data.

Likewise, I wrote as part of the Startup Trigger for Mosaic a command that will send the string "Ready" to QSys, which tells QSYS Mosaic recently restarted (most likely because you updated the project) so Qsys will then send the "QSYSGET" string, thereby refreshing data automatically whenever the Mosaic is updated with new Timelines, scenes or Groups.

The Lua file doesn't seem to be attaching here, so I have a Download link. Which might prove useful if you click later and I've made some tweaks or updates to it.

https://1drv.ms/u/s!Ag5AZbiMaHU6grZF5Zta6L_JLgZ7AA?e=v0bBrD

You'll need an Ethernet Trigger that activates when "QSYSGET" is sent on the bus. that should Run this Script.

You also need a Soft Trigger set to send <s> to the QSYS Core IP and Port over UDP. The number of this soft Trigger is what you need to set the "triggerno" variable inside the script.

Once you've done that, sending QSYSGET to Mosaic should return you 3 Strings formatted like this:

"Times a1,b1,a2,b2,a3,b3, ..... ax,bx,"

"Scenes a1,b1,a2,b2,a3,b3, ..... ax,bx,"

"Group a1,b1,a2,b2,a3,b3, ..... ax,bx,"

Where each term is a Timeline, Scene, or Group that has data stored. a is the Name of the Timeline, Scene or Group, while b is the Number in Mosaic for each one.

And I highly recommend you add to your Startup Trigger an Ethernet

I didn't include anything here on the QSYS side for parsing the strings or how I use them, since I'm approaching this from the Mosaic side of what I did to poll the controller for information about what Targets had data in them. This scripting could in theory work with any other control system that might need to know about these targets.

if there is interest in what I did on the other side to control Mosaic, I'd be happy to talk about some of my more application specific scripts for Mosaic or QSYS.

Related