MIDI control

Using MIDI with LivePrompter

OK, so why would I want MIDI on a teleprompter?

There are a couple of scenarios:

  • Controlling LivePrompter’s buttons (Play/Pause, Next Song, Up, Down, …) via MIDI keys or pedals (e.g. from your master keyboard) without the need to have direct access to a computer keyboard or a touch screen – pretty useful for live musicians that have their hands full
  • Selecting LivePrompter songs from another program, e.g. a sequencer that you use for your playbacks
  • Selecting programs / patches etc. on a MIDI keyboard, an effects device or a light controller when selecting a new song in LivePrompter
  • Controlling a MIDI device at the same time as pressing LivePrompter’s keys, e.g. to synchronize song switches (next song)

Personally, I built MIDI support to synchronize LivePrompter with my favorite VST host, Cantabile (www.cantabilesoftware.com) – any time I select a song in LivePrompter, Cantabile is automatically switched to the same song, so all my sounds are ready to play immediately. Alternatively, if Cantabile is your main program, LivePrompter can also follow Cantabile sending a program change to LivePrompter on loading a song.

Essentially, there are two MIDI control mechanisms in LivePrompter:

  • Sending and receiving program changes: on loading a song, LivePrompter can send a program change associated with the song. Reversely, when LivePrompter receives a program change, it will automatically load the corresponding song. The mappings between program changes and songs are (again) controlled by simple text files.
  • Sending and receiving note and controller commands: every time a LivePrompter key like Pause/Play, Next Song, Up, … is pressed, LivePrompter can send out a MIDI command, either a MIDI note or a specific controller. Reversely, LivePrompter can react to MIDI notes or controllers to remotely press any of the LivePrompter keys, similar to keyboard control, just over MIDI. You could also use this feature to remote-control multiple instances of LivePrompter (for multiple musicians) from one device via MIDI.

Using rtpMIDI (http://www.tobias-erichsen.de/software/rtpmidi.html), you can even do this wirelessly – I use a Windows tablet on my master keyboard to wirelessly remote-control Cantabile on my laptop at the back of the stage!

MIDI configuration

MIDI settings are made in LivePrompter.ini:

MidiInPortThe name of your selected Input MIDI port. If you are unsure about what the exact name is, use the small utility “MidiEnum”, included in the LivePrompter package, which lists the exact names of all MIDI input and output ports in your system 
MidiInChannelThe MIDI channel that Liveprompter should react to. Set it to a number from 1-16 for a specific channel or simply set it to omni to react to all channels
MidiOutPortThe name of your selected Output MIDI port
MidiOutChannelThe MIDI channel that Liveprompter will send on. Set it to a number from 1-16.
MidiOutKeysSet this to true or yes to activate sending out commands on any key press in LivePrompter. If set to false or no, LivePrompter will not send out any keys
MidiOutPCSet this to true or yes to activate sending out program changes on loading a song in LivePrompter. If set to false or no, LivePrompter will not send out any program changes.
MidiInKeysSet this to true or yes to activate receiving commands (note on or control change) for key presses in LivePrompter. If set to false or no, LivePrompter will not react to any commands 
MidiInPCSet this to true or yes to activate receiving program changes to load a song in LivePrompter. If set to false or no, LivePrompter will not react to program changes.
MidiInKeyUpThe MIDI command that will activate the jump-up button. Commands are defined in the following form: CC x (with x being a number from 1 to 127) N x (with x being either a number from 0 to 127 or a note descriptor like C#1 or A-1 with C4 for “middle C”) So typical valid commands are “CC 7”, “N C3” or  “N 64”   To trigger a key, you need to send a note on with a velocity of > 0 or a controller value of >0
MidiInKeyDownThe MIDI command that will activate the jump-down button
MidiInKeyPrevSongThe MIDI command that will activate the previous-song button
MidiInKeyNextSongThe MIDI command that will activate the next-song button
MidiInKeyResetThe MIDI command that will activate the re-start button
MidiInKeyPausePlayThe MIDI command that will activate the the pause/play button
MidiInKeyUniversalThe MIDI command that will activate the universal key
MidiOutKeyUpThe MIDI command that will be sent by the jump-up button. The format is the same as for incoming commands.
MidiOutKeyDownThe MIDI command that will be sent by the jump-down button
MidiOutKeyPrevSongThe MIDI command that will be sent by the previous-song button
MidiOutKeyNextSongThe MIDI command that will be sent by the next-song button
MidiOutKeyResetThe MIDI command that will be sent by the re-start button
MidiOutKeyPausePlayThe MIDI command that will be sent by the the pause/play button
MidiOutKeyUniversalThe MIDI command that will be sent by the universal key
MidiAlwaysSendBankSelectIf “yes”, LivePrompter will always send Bank Select messages for all Program changes´. If “no”, Bank Select messages will only be sent when a different bank than the current one needs to be selected.
MidiChangeToAllOnPCIf yes, then on receiving a program change for a song that isn’t in the currently selected setlist or book, LivePrompter will try to find it in the “All Songs” list and, if found, switch to the “All Songs” setlist.

Mapping songs to program changes

LivePrompter needs to know which program change will activate which song or which program change to send when a song is loaded. I considered building this into the song files themselves, but found it easier to manage with a separate file that keeps all the information organized in one place.

So this mapping is defined in two files that reside in a subdirectory of your song folder called MIDI which contains two text files, called “MidiReceive.txt” and “MidiSend.txt”. To avoid issues with international characters, be sure that they are coded as UTF-8 (same as your song files).

Each of them has the same layout: one line for each mapping that looks like this:

{Bank}.{Program},{SongName}

or simply

{Program},{SongName}

The SongName is simply the file name of your song file, but without the “.txt”.

Since MIDI program changes are restricted to 128 different programs, LivePrompter also allows multiple banks of programs to break this limit. MIDI-wise, this means that a program change is preceded by two bank select commands, namely “bank select MSB” (CC 0) and “bank select LSB” (CC 32), which together tell the recipient of the messages that it should call up the respective program in the addressed bank.

To keep things simple, I’ve avoided the mess with MSB and LSB and simply put in a combined “bank” number. To calculate this from MSB and LSB values, use this simple formula: bank = MSB × 128 + LSB.

So this is what a MidiSend.txt file could look like:

0.1,Addicted To Love 
0.3,Angels 
0.4,Another Brick In The Wall 
0.5,Behind Blue Eyes 
0.7,Brown Sugar

Or alternatively:

1,Addicted To Love 
3,Angels 
4,Another Brick In The Wall 
5,Behind Blue Eyes 
7,Brown Sugar

if you only have 128 or less songs in your list.

Sending Program Changes

When loading a song, LivePrompter will scan through the list of program changes defined in “MidiSend.txt” and try to find a song name that is identical to the file name of the song being loaded. If it finds one, it will send the respective program change (and bank select commands when necessary).

This will even work for playlist entries that don’t reference a “real” song file – entries like “— End of Set 1 —”. If you enter this as a song name in “MidiSend.txt”, Live Prompter will also send the respective program change when you get to this point in your setlist. Nifty, huh?

By default, LivePrompter will only send bank select messages when changing banks, i.e. when the song being loaded is in a different bank. But in case you want to be extra sure (e.g. to avoid conflicts with program changes from other sources that will change the current bank), you can also force LivePrompter to always send bank select commands with every program change. Simply put this line in your LivePrompter.ini:

MidiAlwaysSendBankSelect=yes

Receiving Program Changes

When LivePrompter receives a program change, it will scan through the list of program changes define in “MidiReceive.txt” and try to find an entry with the correct program change. In this, it will also respect any bank select commands received previously and only look with program changes with this bank.

Once it finds a correct program change / bank combination, it will look if its current setlist contains the name referenced. If yes, it will load the corresponding song. It will even automatically open the song window if it isn’t open yet.

Note: LivePrompter will by default only try to find the program in the currently loaded setlist or book. If it doesn’t find the song there, it will NOT change the song. But you can also tell LivePrompter to behave differently: put the following line in your LivePrompter.ini:

 MidiChangeToAllOnPC=yes

Now, if LivePrompter doesn’t find a song in the currently loaded setlist or book, it will search the full list of files in the song directory. If it finds a song there, it will automatically set the list to “all songs” and switch to the song selected by the program change.

OK, that’s all – have fun networking LivePrompter via MIDI!