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

Thread: Teensy 3.0 Buttons to USB MIDI example port failed to open with Pocket Midi

  1. #1
    Junior Member
    Join Date
    Feb 2013
    Location
    Portland, OR
    Posts
    15

    Teensy 3.0 Buttons to USB MIDI example port failed to open with Pocket Midi

    I'm just getting started with the USB Midi examples w/ a Teensy 3.0.
    Am on Arduino IDE 1.8.10 on windows 7 with the latest PJRC Teensyduino libraries.

    I uploaded the Buttons to USB MIDI example and when I run Ableton Live, it successfully receives MIDI note messages from the Teensy! Very cool.

    But then I decided to use a free MIDI diagnostic tool to check what data was coming through, and I ran into a problem.
    I'm using Pocket Midi 1.4.1, but every time I select the Teensy MIDI for either input or output port, I get an error: Port Open Failed.
    This tool works with my other midi controllers, so I'm wondering if anyone has any ideas about what is different about Teensy's USB Midi implementation vs my M-Audio Axiom controller that doesn't exhibit this problem.

    Thanks for any help.

  2. #2
    Junior Member
    Join Date
    Feb 2013
    Location
    Portland, OR
    Posts
    15
    Update- I just tried with MIDI OX and it seems to work, so it must be something funky with Pocket MIDI.

    As before, any shared wisdom is much appreciated.

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,796
    I've never heard of Pocket MIDI before. Is this it? (found by google search)

    https://www.morson.jp/pocketmidi-webpage/

  4. #4
    Senior Member
    Join Date
    Nov 2012
    Posts
    1,176
    I've installed PocketMIDI and tested it with an M-Audio 61-es keyboard connected to the T3.6 USB Host port which then sends the data over USB midi to the PC (Windows 10 Pro).
    Both Midi-Ox and PocketMIDI read key presses from the keyboard.

    Pete

  5. #5
    Junior Member
    Join Date
    Feb 2013
    Location
    Portland, OR
    Posts
    15
    Quote Originally Posted by PaulStoffregen View Post
    I've never heard of Pocket MIDI before. Is this it? (found by google search)

    https://www.morson.jp/pocketmidi-webpage/
    Yep, that's the one. MidiOX is working fine for me at the moment, Pocket MIDI not so much. Not a big problem, but a curiosity.

    -Tom

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,796
    Quote Originally Posted by tomfrisch View Post
    Pocket MIDI not so much.
    Can you create a very simple program (not requiring any other hardware than a Teensy and USB cable) which demonstrates the problem with Pocket MIDI. Maybe just transmit a note on & off or CC message every second. Ideally it would be just a few lines of code in loop() with an empty setup(). The important point is to give us *exactly* the same program you tested which didn't work with PocketMIDI, so we can try to reproduce the problem.

  7. #7
    Junior Member
    Join Date
    Feb 2013
    Location
    Portland, OR
    Posts
    15
    This morning I stripped out all the extraneous code from the USB Midi Buttons example, (basically the bounce library, setting input pins, and debouncing) and now it works fine in both midiOX and PocketMIDI. So just in case, I went back and loaded my original sketch (based off the bounce example) and now it seems to work fine in both as well! Then I went back into Ableton and tested again, and now it's back to the original problem...

    So what I think is happening is that when Ableton is running it locks access to the midi port for PocketMIDI (but not for MIDIOX).
    Now onto solving the next set of problems that I can create for myself.

    Lesson learned, thanks for playing!

    -Tom

  8. #8
    Member
    Join Date
    Aug 2019
    Location
    Melbourne Australia
    Posts
    36
    This is a Windows Class Compliant Midi device driver issue in that you can only make ONE connection to a USB-Midi port. I believe that this is sorted for Win 10.

    So in Win7, we're stuck with "single-client" Midi ports. A workaround is to connect your Teensy Midi ports via Multi-Client Midi pipes.
    I use LoopMidi for this as you can name the pipes in a sensible manner and so far have had no connection issues.

    Here's a shot of the action in LoopMidi and note that it's important to use two pipes as you will get feedback if you try to use only one:-

    Click image for larger version. 

Name:	LoopMidi.jpg 
Views:	0 
Size:	91.4 KB 
ID:	18071
    Next is a shot from MidiOx, and here's how we hook to Teensy:-

    Click image for larger version. 

Name:	MidiOx1.jpg 
Views:	4 
Size:	103.6 KB 
ID:	18073
    Lastly, a view from a second instance of MidiOx, and you can see, I just tweaked a pot.
    Click image for larger version. 

Name:	MidiOx2.jpg 
Views:	1 
Size:	71.3 KB 
ID:	18070

    At this point, the TEENSY IN and TEENSY OUT are Multi-Client any you can make as many connections to them as needed.

Posting Permissions

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