HI. Had a quick look to your code. it cannot work :
if (vrMess[] = { 0xF0, 0x41, 0x10, 0x62, 0x12, 0x00, 0x00, 0x03, 0x01, 0x7C, 0xF7 })
{
digitalWrite(dPin11, HIGH);
digitalWrite(dPin9, LOW);
}
1/ You must use the == to compare 2 values and not the = being an affectation operator
2/ You can't use arrays in that way : , initialize first arrays as const globals then use memcmp to compare them
3/ To reduce memory consumption, define a header first , then the last part of the sysex differing
4/ I'm not sure you are using correctly the MIDI library with sysex here. If you only need to parse SYSEX, simply use the Serial.read(), and wait for SOX (0xF0) to start storing bytes in your array and EOX (0xF7) to stop storing in your main loop. Don't forget to set MIDI baud rate to 31250 in the setup section.
for example :
const byte sysExHeader[] = { 0xF0, 0x41, 0x10, 0x62, 0x12, 0x00, 0x00, 0x03 };
const byte sysEX1[] = { 0x01, 0x7C };
const byte sysEX2[] = { 0x00, 0x7D };
bool startSysEx = false;
bool sysExReceived = false;
byte mySysExArray[256];
unsigned i = 0;
(...)
int readByte;
void setup() {
Serial.begin(31250);
(...)
void loop() {
(...)
/// Real time event are ignored (cf MIDI specs)
if ( ( readByte = Serial.read() ) >= 0 && readByte < 0xF8) {
if ( readByte == 0xF0) {
startSysEx = true;
sysExReceived = false;
i = 0;
mySysExArray[i++] = readByte;
}
else
if ( readByte == 0xF7 && startSysEx) {
sysExReceived = true;
startSysEx = false;
mySysExArray[i++] = readByte;
}
else
if ( startSysEx && readByte <= 0x7F) {
mySysExArray[i++] = readByte;
}
if ( sysExReceived ) {
(...)
if ( memcmp(mySysExArray, sysExHeader,sizeof(sysExHeader)) == 0)
{
if ( memcmp(&mySysExArray[8], sysEx1,sizeof(sysEx1)) == 0)
{
// Do something for SYSEX1
}
else
if ( memcmp(&mySysExArray[8], sysEx2,sizeof(sysEx2)) == 0) {
// Do something for SYSEX2
}
}
(...)
That could be optimized more to store only sysex msg concerning your Roland MIDI device, starting I suppose with 0xF0, 0x41, 0x10, 0x62. But the code is more complex.