0

I have connected my effect processor midi out to arduino midi in shield and I am trying to read sysex messages coming from my effect processor using the Midi library of arduino everything runs fine but when it comes to hexademical number F7 my arduino read 0. I know F7 is 247 does anyone knows why is this happening?

I use this code

#include <MIDI.h>

void handle_sysex(byte *a,byte sizeofsysex)
{
 Serial.println(sizeofsysex,DEC);
 for(int n=0;n<sizeofsysex;n++)
{
Serial.print(a[n]);
Serial.print("  ");
}
 Serial.print('\n');
}
void setup() {
Serial.begin(9600);
// Initiate MIDI communications, listen to all channels
MIDI.begin(MIDI_CHANNEL_OMNI);    
MIDI.setHandleSystemExclusive(handle_sysex);
}
void loop() {
// Call MIDI.read the fastest you can for real-time performance.
MIDI.read();
}
Cœur
  • 37,241
  • 25
  • 195
  • 267
user3488022
  • 25
  • 1
  • 4
  • Is that the only number that is wrong? Or is it a range of values? How do you know what value is being sent? – Floris Apr 10 '14 at 16:19
  • Yes it is the only one , I know because I have also Midi Ox connected to check if arduino reads correct – user3488022 Apr 10 '14 at 16:34
  • Could it be simply that the `F7` is the "end of message" character and it just gets converted to "end of string"? See http://en.wikipedia.org/wiki/MIDI_Machine_Control#MIDI_Universal_Real_Time_SysEx_Message_Format – Floris Apr 10 '14 at 16:40
  • @Floris In MIDI, 0 is a valid data byte; converting F7 would be an horrible bug. – CL. Apr 10 '14 at 17:03

1 Answers1

1

This was discussed on github and it looks like it was a bug fixed by either #67 or #66. The args for handler function changed too, second arg is now unsigned size to allow for size beyond 255.

KevinJWalters
  • 193
  • 1
  • 7