usbMIDI library confusion ...

kaspencer

Member
For quite sometime, it seemed that code produced via the Arduino IDE used usbMIDI without a usbMIDI.h include.
However, since I upgraded to the Arduino IDE v2.0.3, this seems not to be so, and the code below:
Code:
void setup()
{//1. Declare usbMIDI Event Handlers:
 usbMIDI.setHandleNoteOn  (OnNoteOn);
 usbMIDI.setHandleNoteOff (OnNoteOff);
 // ...
}// END setup()
generates a Compilation Error: usbMIDI.h: No such file or directory.
BUT inclusion of usbMIDI.h gives error "File/Directory not found"!

So: which usbMIDI library is advised? I'd prefer to use a Teensy usbMIDI library

In hope,
KASpencer
 
Did you set Tools > USB Type to "MIDI"?

1701002142113.png


Paul
 
Thankyou, Paul ...
... Yes, it is set to "COM9 Serial + MIDI (Teensy4.1)"
And I have just checked the USB Type: and it seems that the IDE update removed the USB Type selected previously, which I have now corrected.
And I'm pleased to say that it now compliles properly.
Thanks again.
Kenneth
 
Last edited:
Back
Top