Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 6 of 6

Thread: USB Midi on teensy 4.0

  1. #1
    Junior Member
    Join Date
    Oct 2019
    Posts
    4

    USB Midi on teensy 4.0

    Hello! Im trying to build a digital synthesizer and I need to be able to read the output of a MIDI keyboard on the teensy and then create waveforms based on the MIDI signals.

    My question, however, only pertains to the actual MIDI communication. All the examples I can find use USB midi library (https://www.pjrc.com/teensy/td_midi.html), programmed through Arduino IDE.
    I'm supposed to select MIDI as the USB type, but this option is not available to me. I only see serial when I have the teensy 4.0 selected.
    Why is this? What does this option even enable and is it possible to enable the same functionality manually?
    Does anybody have another approach that I should use instead?

    Kind regards,
    Frederik.

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,684
    USB MIDI device mode (not yet supported on Teensy 4.0) is used for Teensy to communicate with your PC or Mac. You'd normally use that if you're making a MIDI controller.

    For connecting a MIDI keyboard to Teensy, you'd use either USBHost_t36 (if the keyboard is a USB interface) or the MIDI library (if old-style MIDI with the 5 pin DIN connector). The good news is both of those work on Teensy 4.0.

  3. #3
    Junior Member
    Join Date
    Oct 2019
    Posts
    4
    Huge thanks! I'll check it out.

  4. #4
    Junior Member
    Join Date
    Oct 2019
    Posts
    4
    On GitHub ( USBHost_t36/examples/Serial/MIDI/InputFunctions/InputFunctions.ino ), I see in the example that I am still supposed to select the the USB type as midi. "You must select MIDI from the "Tools > USB Type" menu" is written as a comment in the beginning of the file. I still can only select serial. Can I ignore this, or is there a way to manually select MIDI in a setup file etc?.

  5. #5
    Junior Member
    Join Date
    Oct 2019
    Posts
    4
    Quote Originally Posted by PaulStoffregen View Post
    USB MIDI device mode (not yet supported on Teensy 4.0) is used for Teensy to communicate with your PC or Mac. You'd normally use that if you're making a MIDI controller.

    For connecting a MIDI keyboard to Teensy, you'd use either USBHost_t36 (if the keyboard is a USB interface) or the MIDI library (if old-style MIDI with the 5 pin DIN connector). The good news is both of those work on Teensy 4.0.
    I've copy pasted the example sketch mentioned in the above comment, and have connected the MIDI keyboard to the T4 USB port through a simple USB-A to micro-USB board (This also allows me to probe the connection).

    When I power up the teensy and keyboard, the D+ pin simply goes high, indicating full-speed mode and then nothing more happens.
    Did I misunderstand how to use the usbhost_t36 library?

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,684
    Run the File > Examples > USBHost_t36 > Test > Test example.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •