MidiAlert – popping up status messages

Some time ago, I built a little helper program called “MIDI Alert” that allowed you to display simple “splash” messages on screen via MIDI sysex commands. Since MIDI Alert became a very useful companion program to LivePrompter, I decided to integrate its functionality in LivePrompter to make life easier for me 😉.

How it works

I built the MIDI Alert functionality for my work with Cantabile, my favorite live VST host. When playing live with VST instruments, I sometimes felt the need to flag some status information very visibly on my LivePrompter tablet, for example to remind me that an effect is momentarily muted by a controller, or that a state change has happened.

So I created a functionality that waits for specific MIDI messages and then pops up an alert box in the middle of the screen. It allows you to specify different behaviors of your alerts in your message: “open”, “close”, “toggle” or “flash” (display for a certain time and close then). Beware: alert message boxes are exclusive – while one is displayed, no other can be triggered! No alert box madness with this tool 😉

Now that MIDI Alert is integrated with LivePrompter, all you need to do is send a MIDI System Exclusive (let’s call it SysEx from now on, OK?) message to LivePrompter on its MIDI input port (see the chapter “LivePrompter and MIDI” on how to configure it). Once LivePrompter recognizes a correct sysex message, it will display the alert specified in the message. That’s all there is to it!

The Sysex Message

A SysEx message recognized by MIDI Alert looks like this (in hex):

F0 7D 4D 41 <num> <type> <color> <message> F7

The first four bytes just need to be there; F0 is the MIDI command for SysEx, 7D is a universal manufacturer code, and 4D 41 stand for “MA” (MIDI Alert), so LivePrompter knows that this message is a MIDI Alert.

<num> is a number from 0 to 127 to identify the alert. Identifying the alert is necessary to make sure that LivePrompter knows what alert a “toggle” or “close” message  belongs to – if it didn’t, funny things could happen when alerts overlap.

<type> has four options, coded in one single letter (ASCII):

  • S: show – the alert gets displayed (unless another one is currently open) and stays open
  • H: hide – if an alert with the number <num> is open, it gets closed
  • T: toggle – if no alert is open, the alert gets displayed and stays open; if an alert with the number <num> is open, it gets closed
  • F: flash – the alert gets displayed and closes on its own after the time set in MidiAlert2.ini

<color> defines the color of the alert box:

  • B: blue
  • G: green
  • R: red
  • Y: yellow
  • O: orange
  • P: purple
  • E: grey
  • W: white
  • K: black

The message is simply an ASCII string containing the message you want displayed. At the end of the message, 0xF7 is mandatory, so MIDI (and LivePrompter) know that the SysEx message ends

In Cantabile, it’s pretty easy to create SysEx message, especially for bindings: you set the binding target to a MIDI output port, the action to Sysex, then enter your SysEx string in the SysEx editor (you may need to widen the “Action” column a bit to see the SysEx data!). You don’t need to enter everything in hex, but you can also use strings, so you may enter a message like this:

0xf0 0x7d 0x4D 0x41 1 "S" "R" "Hello World!" 0xF7

This will show alert #1 in red with the message “Hello World!”. The corresponding hex sysex looks like this:

F0 7D 4D 41 01 53 52 48 65 6C 6C 6F 20 57 6F 72 6C 64 21 F7

Since this message will only open alert #1, you’ll need another one to close it (this time, we’ll use “MA” instead of 0x4D 0x41, just because we can 😉)

0xf0 0x7d "MA" 1 "H" "R" 0xF7

or in plain hex:

F0 7D 4D 41 01 48 52 F7

This one doesn’t need a message, since it only closes the box.

In Cantabile, you can also use variables to define your strings, which is super-powerful. For example, the following Sysex message in a SongState->OnLoad binding will display the currently loaded song and state in an alert for some seconds (the number 4 is simply an example – choose a unique one so this doesn’t conflict with another alert with a different number):

0xf0 0x7d "MA" 4 "F" "G" SongTitle " - " State 0xF7

Convenient – isn’t it?

Configuration settings

These are the settings in LivePrompter.ini to configure MIDI Alert.

MidiInAlertsSet this to true or yes to activate showing alert messages on receiving correct SysEx commands. If set to false or no, LivePrompter will not react to any alert messages 
AlertWindowWidth, AlertWindowHeightSize of the alert window in pixels
AlertTextSizeFont size in points
AlertDisplayNumberFor multi-monitor setups set this to the number of the display you want to show alerts on. You can find the correct number in the Windows display properties (“Identify”).
FlashDurationHow long (in seconds) should “flash” alerts be displayed before closing automatically. Has no effect on “toggle” or “momentary” alerts

Have fun using MIDI Alerts with LivePrompter!