Mar 092012

Converts between MIDI, DMX, RS-232 Serial and IR

The DecaBox Universal Protocol Bridge - Click to Enlarge

MIDI Note Inputs Trigger Arbitrary RS-232 String Outputs

We were contacted by a group who was using the Mac OS-based QLab software to run their show.  Part of the show involved a pair of large frame video projectors (a Barco FLM HD20K and a Panasonic whose model number I can’t recall).  The designers needed to control the internal shutters on these two large projectors, but QLab doesn’t allow serial output.  However, its toolkit includes a full complement of MIDI note and show control message generators.

So, we developed a firmware build for the DecaBox which accepts MIDI input (any combination of note on, note off and program change) messages, and outputs serial strings up to 40 characters long.  Setup is based on a very simple text file called ‘map.txt’ which is stored on the DecaBox’s internal SD memory card.

Map.txt looks like this:

; DecaBox Protocol Converter
; Engineering Solutions Inc
; Firmware for converting MIDI messages into
; RS232 serial strings, in a user-configurable way.
; This file is called map.txt and should be edited
; in either TextEdit (OS X) or Notepad (windows). Other programs,
; such as Word, may introduce unwanted garbage characters in the file.
; Note that lines which begin with a semicolon are comments, and
; are ignored by the firmware. A line can contain a comment or a command,
; but not both.
; First define the MIDI channel used to receive data. This is a two
; digit decimal number with the range [01 16]
; In this example, we’re using MIDI channel 1
CHN 01
; Next define the baud rate for the RS232 output. Valid values are
; 9600, 19200, 38400, 57600. No commas are used.
; Default baud rate is 9600
BAU 9600
; Finally, define the cues which will be transmitted.
; This is done by selecting the MIDI note to be monitored, the note
state (ON or OFF),
; and the RS232 string to be generated.
; Characters which aren’t human readable and editable in a
; text editor (such as carriage return, line feed, STX,
; ETX and so forth, are defined by the escape sequence $AB, where AB
is a two digit
; hex representation of a single byte to be transmitted. Valid range
of AB is [00 FF]
; Leading zeroes may be required, depending on desired value.
; The protocol is not case sensitive. $AB == $ab == $Ab == $aB
; For example, to generate the string ‘Hello World’ + carriage return when MIDI
; note #3 is ON, use this syntax:
; N003 Hello World$0d
; Note that each line begins with either “N” or “F” (signifying Note ON or
; Note OFF, and is followed by a three digit note number, then another space,
; then the beginning of the string.
; Strings made entirely of hex characters can also be built using the
; abovementioned
; escape sequences. Here’s how to send the five bytes $02 $04 $10 $22 $38 when
; note #6 is turned off
; F006 $02$04$10$22$38
; If the $ character itself needs to be transmitted as part of a serial
; string, it must be encoded as the hex character 24.
; F006 $02$04$10$22$38$2F$24
; MIDI notes can be added to this table in any order. If a note is duplicated,
; the string appearing farther down in the table will overwrite an
; earlier value.
; Up to 32 string characters can be assigned to each MIDI note.
; Finally, MIDI Program Change messages can be used to
; generate serial output. These are preceded by a ‘P’
; and the other syntax information above applies.
; Note that (currently) only program change messages 1-48 are
; supported due to processor memory space
;; The actual MIDI to RS232 Patch Chart begins here:
; Here’s a string for triggering the shutter on a Panasonic projector
N001 $02ADZZ;OSH:1$03
; and this turns it off
N002 $02ADZZ;OSH:0$03
; Here’s shutter close for Barco:
N003 $FE$01$23$42$00$66$FF
; And here’s open:
N004 $FE$01$22$42$00$65$FF
; Other sample commands for testing, etc.
;P001 MIDI Program Change #1 Received
;P002 MIDI Program Change #2 Received
;P004 MIDI Program Change #3 Received
;;N001 Midi Note 001 Received$0d
;;F001 Hey! Someone just released note #1$0d
;;N002 —>Here’s note number two!!$0D
;F002 _Stop Cue 123.45.67$0D$0A
;N005 Go Pyro Finale$0D
;N006 Open Trapdoor Stage Left$0A
;F006 $02$04$10$22$38$2F
;F007 Foo!$0D
;N128 Highest Note!$0d

Here’s a screenshot from terminal program RealTerm, showing the Panasonic and Barco strings generated by the DecaBox.  Note that the Barco data looks garbled but it’s actually ok – only a few of the bytes required by Barco are human-readable.


That’s pretty much it.  The system runs exactly as expected.

Here’s a couple pictures from the production.  The projection control was handled by

Jordan Goodfellow
The RARE Experience

Since the control system was located quite far from the stage, a pair of RS232-over-CAT5 converters were procured to reliably span the distance.

A Pair of DecaBox Protocol Converters, Plus RS232 Baluns for CAT5 Transmission

Note here that MIDI data is daisy-chained from the QLab computer to the first DecaBox, and then to the second one.

If you need something like this for your next production, just let us know.  And thanks again, Jordan, for the chance to work with you on this project.


 Posted by at 6:06 pm

Sorry, the comment form is closed at this time.