Hello everyone,
a few weeks ago I enquired about using Teensy 3.6 to interface new USB MIDI controller keyboards to old (DIN) MIDI synths, and received great support (thanks!).
Now I have my shiny new Teensy 3.6, a proper USB cable connected to the USB Host header on the Teensy, and a USB MIDI keyboard attached to it (cheap JamminPro PK25).
To get things started, I tested the nice "InputMethods" sample sketch from "USBHost_t36" library (from brand new Teensyduino 1.41), and I can see the various MIDI messages being properly received and decoded by the Teensy on the Serial Monitor.
So everything seems to work OK.
Now the (two) questions.
I am building a simpler version of this board:
https://www.pjrc.com/teensy/td_libs_MIDI.html
with only MIDI OUT port (that's all I need) and the needed corrections to work at 3.3v
I need to write a sketch which:
- detects if a MIDI USB Keyboard is attached to USB Host port (needed to give user feedback via status LED)
- "blindly/dummily" forwards *all* incoming USB Host MIDI messages (without handling them) to the (serial) UART MIDI output port
I'm not sure how to procede.
1) To start, I can't seem to find a method equivalent to, say "isMidiDeviceAttached(USBHostPort)".
2) Then, the "InputMessages" sketch works by settings a lot of handlers and "doing stuff" inside the handlers (writing debug to serial monitor); I don't need to decode/handle MIDI messages, I just want to forward them as is; but I don't seem to find a way to get a MIDI message from
and write it as is to the output MIDI serial port defined by
Do I really need to explicitely handle every possible MIDI incoming message and then, inside each handler, use for example
etc. etc.?
I mean, there should be a way to do say
...right?
Thanks a lot!!
Fernando
a few weeks ago I enquired about using Teensy 3.6 to interface new USB MIDI controller keyboards to old (DIN) MIDI synths, and received great support (thanks!).
Now I have my shiny new Teensy 3.6, a proper USB cable connected to the USB Host header on the Teensy, and a USB MIDI keyboard attached to it (cheap JamminPro PK25).
To get things started, I tested the nice "InputMethods" sample sketch from "USBHost_t36" library (from brand new Teensyduino 1.41), and I can see the various MIDI messages being properly received and decoded by the Teensy on the Serial Monitor.
So everything seems to work OK.
Now the (two) questions.
I am building a simpler version of this board:
https://www.pjrc.com/teensy/td_libs_MIDI.html
with only MIDI OUT port (that's all I need) and the needed corrections to work at 3.3v
I need to write a sketch which:
- detects if a MIDI USB Keyboard is attached to USB Host port (needed to give user feedback via status LED)
- "blindly/dummily" forwards *all* incoming USB Host MIDI messages (without handling them) to the (serial) UART MIDI output port
I'm not sure how to procede.
1) To start, I can't seem to find a method equivalent to, say "isMidiDeviceAttached(USBHostPort)".
2) Then, the "InputMessages" sketch works by settings a lot of handlers and "doing stuff" inside the handlers (writing debug to serial monitor); I don't need to decode/handle MIDI messages, I just want to forward them as is; but I don't seem to find a way to get a MIDI message from
Code:
MIDIDevice midiUSBInput(USBHostPort)
and write it as is to the output MIDI serial port defined by
Code:
MIDI_CREATE_INSTANCE(HardwareSerial, Serial1, MIDISerialOutPort)
Do I really need to explicitely handle every possible MIDI incoming message and then, inside each handler, use for example
Code:
MIDISerialOutPort.sendNoteOn(...)
etc. etc.?
I mean, there should be a way to do say
Code:
midiMessage = midiUSBInput.readNextMessage();
MIDISerialOutPort.sendMessage(midiMessage);
...right?
Thanks a lot!!
Fernando
Last edited: