I tried both suggestions and there was no change in behavior. It works when MIDI-OX is running and doesn't work when it's not running. This isn't a problem with reading the wrong MIDI channel. When it works, it works on all MIDI channels. This function works as expected on all channels when MIDI OX is running:
Code:
void handleNoteOn(byte channel, byte note, byte velocity)
{
usbMIDI.sendNoteOn(note, 99, channel);
digitalWrite(led, HIGH);
Serial.print("Note On, ch=");
Serial.print(channel, DEC);
Serial.print(", note=");
Serial.print(note, DEC);
Serial.print(", velocity=");
Serial.println(velocity, DEC);
}
Interestingly, I tried compiling / running with Tools - > USB Type: "Serial + MIDI" and it doesn't work at all /ever. I had been compiling with USB Type "Serial + MIDIx4". I think I read somewhere that this is what gives you the class compliant behavior. The x4 is like 4 virtual cables where each cable has 16 channels. I need my controller and my Teensy using the same virtual cable.