(Originally posted in 'programming' by mistake)
I'm just starting to use the midi library and having problems getting callbacks to work. Longer term aim is a midi filter but at the moment just trying to get the basics to work....
#include <MIDI.h>
void HandleNoteOff(byte channel, byte pitch, byte velocity) {
MIDI.sendNoteOn(37,127,15);
}
void setup() {
MIDI.begin(MIDI_CHANNEL_OMNI); // Launch MIDI with OMNI in and thro on
MIDI.setHandleNoteOff(HandleNoteOff);
}
void loop() {
MIDI.read() ;
}
The basic midi through is working fine. Using a keyboard for input and MIDI-OX to monitor the output, you can see each note-on and note-off come through fine when a key is pressed and released BUT there is no extra note-on which the callback function should generate from each note-off.
(Long term, there will be a pile of filters programmed in the callback function)
Any idea what I'm doing wrong??
Thanks