Hi,
I’m migrating my native Arduino IDE project to PlatformIO and I want to use the usbMIDI Library from the Teensyduino IDE, how can I integrate the default Teensyduino libs in my project?
Hi,
I’m migrating my native Arduino IDE project to PlatformIO and I want to use the usbMIDI Library from the Teensyduino IDE, how can I integrate the default Teensyduino libs in my project?
ok, I just installed the core libraries via the PIO terminal
pio lib -d ./lib install https://github.com/PaulStoffregen/cores.git\#1.35
but I’m still getting the error
usbMIDI.setHandleNoteOff(onNoteOff);
The Problem seems that the Teensyduino IDE automatically creates the usbMIDI Instance:
// Preinstantiate Objects //////////////////////////////////////////////////////
usb_serial_class Serial = usb_serial_class();
usb_midi_class usbMIDI = usb_midi_class();
But even if I’m including the “usb_api.h” in my class I’m getting this error
Any suggestions on that?
I’m using the USB MIDI in my current project. Add the following line to platformio.ini
:
build_flags = -DUSB_MIDI
Here’s my platformuo.ini
file:
[env:teensy31]
platform = teensy
board = teensy31
framework = arduino
build_flags = -DUSB_MIDI
I didn’t have to install anything extra. And thanks, I didn’t know there was a note handler event! You just made my day. I was doing it differently.
Hi James,
thanks for your reply … it solves my problem
I’m totally new to C++ and I have many “little” issues to deal with … that was one of them
Regarding the Handler: Teensyduino: Using USB MIDI with Teensy on the Arduino IDE
Currently I’m dealing with passing my member function of my EncoderWrapper-Class to the set[…] functions of usbMIDI … it seems to be very different in C++ to pass functions (in that case a function pointer?) to another function …