dump, which I later realized is why I
didn’t have any code that made the
game react. All game functions react
to SysEx messages, not note events. This
is why a guitar synthesizer cannot be
plugged in to Rock Band and just work.
At this point, I requested more dumps,
where different frets were pressed down
with the same string pressed.
I converted all the dumps I had to
decimal and compared SysEx messages
to note messages and found a correlation.
Here’s the resulting structure of the
messages (displayed in decimal):
Part 1 2 3 4 5 6 7 8 Sample 240 8 64 10 1 1 43 247
; Part 1: starting byte of a SysEx message.
; Part 2, 3, 4: identifiers that this is a
SysEx message used by the Mustang.
; Part 5: message type (1 = set fret
position, 5 = play string).
; Part 6: midi channel (string on the
instrument).
; Part 7: midi note number.
; Part 8: end SysEx message.
The Software
To explore the message format, I put
together a quick program for sending a
combination of note events and SysEx
64 | SEPTEMBER 2011 WWW.LINUXJOURNAL.COM
messages to the game. I know that the
guitar synthesizer hardware required to
use the software I was writing isn’t very
common, so I want to be proactive in
removing any limitations to people using
it. I’ve done midi and C++ programming
with ALSA under Linux before, but never
midi on Windows or OS X, and I wanted
to be able to support all three to make
the software more accessible.
std::vector<unsigned char> sysExMessage;
sysExMessage.push_back( 240);
sysExMessage.push_back( 8 );
sysExMessage.push_back( 64 );
sysExMessage.push_back( 10 );
sysExMessage.push_back( 1); // 1 sets fret position,
// 5 to play the current string
sysExMessage.push_back( channel + 1 ); // channel
sysExMessage.push_back( note );