I am trying to set up a Teensy USB MIDI Host and I am having trouble getting the MIDI routing / mapping to work the way I want.
Here is a trivial example code to demonstrate my problem:
The above code was used in the Arduino IDE with USB option set for USB Type: "Serial + MIDIx4".
If I have MIDI-OX running and the MIDI Inputs and Outputs are selected correctly in MIDI-OX, the Teensy works as expected.
It also works with Ableton Live running if the midi in and midi out are configured. If neither of these programs are running, the Teensy doesn't receive any MIDI messages. My goal is to use the Teensy as a host to read MIDI messages from a class compliant controller (Behringer X-Touch Mini) and control LED light strings (without Ableton or MIDI-OX running).
Thanks!
Here is a trivial example code to demonstrate my problem:
Code:
#include <MIDI.h>
const int led = LED_BUILTIN;
void handleNoteOn(byte channel, byte note, byte velocity)
{
digitalWrite(led, HIGH);
}
void handleNoteOff(byte channel, byte note, byte velocity)
{
digitalWrite(led, LOW);
}
void setup()
{
Serial.begin(115200);
Serial.println("Setting Up");
usbMIDI.setHandleNoteOn(handleNoteOn);
usbMIDI.setHandleNoteOff(handleNoteOff);
}
void loop()
{
usbMIDI.read();
}
The above code was used in the Arduino IDE with USB option set for USB Type: "Serial + MIDIx4".
If I have MIDI-OX running and the MIDI Inputs and Outputs are selected correctly in MIDI-OX, the Teensy works as expected.
It also works with Ableton Live running if the midi in and midi out are configured. If neither of these programs are running, the Teensy doesn't receive any MIDI messages. My goal is to use the Teensy as a host to read MIDI messages from a class compliant controller (Behringer X-Touch Mini) and control LED light strings (without Ableton or MIDI-OX running).
Thanks!