Walkthrough: Setting up midi-relay on MacOS to control Chroma Q Vista 3 with a Stream Deck over the network

I have had a few people ask if I could post another walkthrough with more precision on setting up midi relay to control Chroma Q Vista (formerly owned by Jands) with their stream decks.

What you will need:

  • MacOS running Vista 3 (Vista 2 will also work)
  • Node.js installed, or you can download the MacOS binary release of midi-relay here: https://github.com/josephdadams/midi-relay/releases
  • Bitfocus Companion installed and running on a computer/device (it can be the same computer running Vista, or another computer on the network)

To set it all up:

  1. First, you will need to set up the loop-back MIDI port. Open Audio MIDI Setup. It’s in Applications > Utilities.
  2. In the Audio MIDI Setup window, choose Window from the top menu, then Show MIDI Studio.
  3. This opens the MIDI Studio window. You will see a few options here such as BluetoothIAC Driver, and Network. Depending on how you may have configured MIDI ports in the past, the number of devices here can vary.
  4. Double click the IAC Driver device. This will open the Properties window. The main thing you need to do is click the checkbox for “Device is online” (if not already checked). You may also want to change the device name to Vista.
  5. You can close out all of the Audio MIDI Setup windows now.
  6. Now you need to start midi-relay running. Open a Terminal window and change directory to where you put the executable file for midi-relay. I put mine in a subfolder within the Documents folder. It’s important that you run the executable while the Terminal window directory is the same folder the executable is in, or things may not work correctly. Once you’ve changed directory to the correct folder, you can drag the executable file from Finder to the Terminal window, or you can type in the executable name manually. Hit enter to run it.
  7. When midi-relay starts up, it will give you a read-out in the console of all the available MIDI in/out ports. You should now have one that says Vista Bus 1.
  8. Open Vista. Go to the User Preferences menu by selecting File > User Preferences.
  9. Go to the MIDI tab.
  10. Under the MIDI Show Control section, set the Device ID to 0 (zero).
  11. Under the External MIDI Ports section, check the box next to the Vista Bus 1 MIDI port.
  12. Click OK.
  13. In Vista, right click on the cue list you want to use with MIDI control, and choose Properties.
  14. Go to the MIDI tab.
  15. Now open the Companion Web GUI on the computer that is running Companion.
  16. Add a new instance by searching for Tech Ministry MIDI Relay.
  17. In the instance configuration, type in the IP address of the computer running Vista and midi-relay. If you’re running Companion on the same computer, you can use IP address 127.0.0.1.
  18. Click Apply Changes.

To Send a MIDI Note On and advance a cuelist:

  1. Add a new button in Companion.
  2. Add a new action to that button, using the midi-relay action, Send Note On.
  3. Under the options for this action, choose the Vista Bus 1 for the MIDI port.
  4. By default, it will send channel 0, note A0 (21), with a velocity of 100. Vista does not look for a specific velocity value, only channel and note. Vista will listen to any channel by default, but if you set a specific channel in the Vista MIDI settings, you will need to make sure you send the correct channel from Companion.
  5. Go back to Vista and in the Cuelist PropertiesMIDI tab, click Learn next to the Play item. The Play command is what advances a cuelist. The Learn function will listen for incoming MIDI notes and makes setting the MIDI note slightly easier (and it proves that it works). You can also just set the note manually if you want.
  6. Go back to Companion and click Test Actions (or press the physical button on your stream deck if you are using one), and the Learn box in Vista will go away, and you’ll see that the note you sent from Companion is now populated in the Vista settings.
  7. Now every time you press that button in Companion, it will advance that cuelist. If you have multiple cuelists, you will need to use different MIDI note values.

To Send a MIDI Show Control message to go to a specific cue in a cuelist:

  1. Add a new button in Companion.
  2. Add a new action to that button, using the midi-relay action, Send MSC Command.
  3. Choose Vista Bus 1 for the MIDI port.
  4. The default Device ID is 0 (zero) but if you changed that in Vista, make sure it matches here.
  5. The Command Format should be Lighting – General and the Command should be Go.
  6. The Cue field should be the specific Cue Number in Vista of the Cuelist you want to control.
  7. The Cue List field should be the specific Cuelist Number in Vista.
  8. Now every time you press that button in Companion, it will go to that specific cue in that specific cuelist.

Here’s a walkthrough video of these steps:

[wpvideo HZriRGlS]

I hope this is helpful! If you’re using MIDI relay, feel free to drop a comment and share how it is working for you!

Sending automated reminders via a Slack webhook, AppleScript, and Launchd on MacOS

I have always enjoyed finding ways to automate processes, especially ones that don’t require much user interaction but just need to be done at a certain time or at regular intervals. At one of my first jobs out of high school, I wrote software to automate a job for one of the clients that normally took 2.5 days by hand, taking the process down to 30 minutes, including filling out all the paperwork. Of course, the company didn’t like losing those billable hours, but it was hard to argue with the efficiency.

At my church, we have a few computers with limited drive space. And that drive space always fills up fast! In the past, I would check the drives periodically and either delete old files or move them off to another storage place. I sat down recently and decided to take that a step further: I only wanted to be notified to check the drive when the drive was full to a certain threshold.

I’ve been playing around with Slack recently with a project I’m working on at home to notify me when my laundry is finished. If you’ve not heard of Slack, it is a collaboration/communication tool that integrates with lots of other platforms. It’s like a work-specific chatroom on steroids. One of the ways you can use it is with custom apps and webhooks, providing an easy way to send data and interact via a custom URL.

I won’t delve into setting up Slack and webhooks here, but I did want to share with you how I accomplished my goal to only get notifications when the drive is full to a certain amount. I used AppleScript and the Launchd framework built into MacOS.

If you’ve been on the Mac platform for awhile, you’ve no doubt heard of and have maybe used AppleScript. It’s a great way to interact with Mac apps and the system as a whole, so you can automate all kinds of things.

Launchd, as defined by Apple, is “a unified, open-source service management framework for starting, stopping and managing daemons, applications, processes, and scripts.” This framework is always working in the background on MacOS, whether you knew it or not!

So, I sat down and wrote an AppleScript that does the following:

  • Polls the system for the available space on the hard drive(s) I specified
  • If the space remaining is a certain amount or less, it sends a webhook request to my Slack app with a custom message to remind me to clear up the particular drive.

Screen Shot 2019-03-07 at 9.40.27 PM

Now, to schedule it. In the past, I used to use the built-in iCal/Calendar app for MacOS. It worked ok sometimes but I found that there were times scheduled events simply didn’t run for whatever reason. So, I decided to use a different method and take advantage of the Launchd process built into the operating system. There’s a lot you can learn about Launchd for MacOS, but I’ll summarize it here:

  • You can run processes as daemons, which run at the system level, not the user level
  • You can run processes as agents, which run at the user level
  • You can have them run when the system loads, or you can schedule them
  • Depending on where you place the file with the instructions about your script determines whether it runs as a daemon or agent

I chose to have mine run on a schedule every day at 7am, and send me an alert if the drive(s) are too full. I didn’t need it to run at the system level, so I made it an agent.

Screen Shot 2019-03-18 at 9.22.16 AM.png
This is the file that MacOS will look at to schedule the script to run.

Once I placed this file in my ~/Library/LaunchAgents/ folder (my main user account’s Launch Agents folder) and restarted the computer, it was ready to go! I’m looking forward to not having to remember to check those drive spaces manually anymore. I’ll automatically get notifications on my phone when I need to clear up space!

IMG_9213
This is what the alert looks like on my phone.

I hope this helps you! If you want any of the scripts, they’re up on Github.