Hallo,
i am new to the Arduino.
I have learnd a lot here, but my actual Problem now, i can't find help.
So now i hope someone fine my mistake:
I want to receive SysEx Messages from my Grand MA 2.
On my Test Setup with a Midi reading software i read this bytes:
F0 7F 7F 02 7F 06 01 01 32 64 F7
Here is my sketch that I what to use:
#include <MIDI.h> //activate MIDI
MIDI_CREATE_INSTANCE(HardwareSerial, Serial1, midiA); //Set Midi In to RX1 on Arduino MEGA
void setup() {
Serial.begin(9600); // activate USB on RX/TX0
// Initiate MIDI communications, listen to all channels
midiA.begin(MIDI_CHANNEL_OMNI);
//read SysEx
midiA.setHandleSystemExclusive(handle_sysex);
}
void loop() {
// Call MIDI.read the fastest you can for real-time performance.
midiA.read();
}
//SysEx:
void handle_sysex(const byte* a,byte sizeofsysex){
Serial.println(sizeofsysex,DEC);
//Print Sysex on Serial0 on PC:
for(int n=0;n<sizeofsysex;n++){
Serial.print(a[n]);
Serial.print(" ");
}
Serial.print('\n');
}
And here is the Error from the Compiler:
Arduino: 1.6.3 (Mac OS X), Platine: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"
midi-sysex-test.ino: In function 'void setup()':
midi-sysex-test.ino:11:44: error: invalid conversion from 'void ()(const byte, byte) {aka void ()(const unsigned char, unsigned char)}' to 'void ()(byte, unsigned int) {aka void ()(unsigned char, unsigned int)}' [-fpermissive]
In file included from /Users/xxxx/Documents/Arduino/libraries/MIDI/MIDI.h:224:0,
from midi-sysex-test.ino:1:
/Users/danielwitka/Documents/Arduino/libraries/MIDI/MIDI.hpp:966:49: error: initializing argument 1 of 'void midi::MidiInterface<SerialPort, Settings>::setHandleSystemExclusive(void ()(byte, unsigned int)) [with SerialPort = HardwareSerial; Settings = midi::DefaultSettings; byte = unsigned char]' [-fpermissive]
template<class SerialPort, class Settings> void MidiInterface<SerialPort, Settings>::setHandleSystemExclusive(void (fptr)(byte array, unsigned size)) { mSystemExclusiveCallback = fptr; }
^
Can anyone help me to find my mistake?
Daniel