Can't send MIDI message to one of my devices

zagoda

Member
Hey there, I'm a software developer (javascript) but new to electronics programming, I recently started working with Teensy 4.1. I'm trying to create a MIDI router (route messages from A to B with filters). I managed to create my initial setup and I'm able to receive and send midi messages from and to devices connected to usb host port via a usb hub on Teensy 4.1.

However, I am facing issues with this single device: Korg minilogue xd . It does send MIDI messages to Teensy and my program can read them. However, I am not able to send MIDI messages to it from Teensy. Can someone help me debug this?

Some information, when I connect Korg Minilogue xd to my Mac, it actually shows uo as 2 devices which is strange Screenshot 2023-10-03 at 09.36.51.png
 

Attachments

  • Screenshot 2023-10-03 at 09.34.55.png
    Screenshot 2023-10-03 at 09.34.55.png
    5.9 KB · Views: 100
Omg setting cable to 1 or 2 when sending worked, I guess each of those devices my Mac shows correspond to a cable in Teensy world, but how do I get names for them?
 
Look in the USB MIDI 1.0 specification.

https://www.midi.org/specifications-old/item/usb-midi-1-0-specification

When you have download the PDF file, look at Figure 8 on page 16.

View attachment 32091


Thanks Paul! Here is a follow up question, feel free to reply with "Read the specs!" if it's there.

I'm guessing when a midi device is connected to host it somehow broadcasts the cables it uses and the names for them and that is how the applications on my Mac can show those "port/cable" names for the midi devices I have.

Does USBHost_t36 provide a way to get this information from the usb device? I essentially want to get the names for the "cables" on a usb midi device
 
Screenshot 2023-10-03 at 11.40.00.png
It could be Midi Out and Midi In Jack descriptors. jack and cable might be completely different things but I'll check, I'll probe USBHost_t36 so see if I can get these names
 
nah I could not find anything. here is my debug dump from teensy 4.1 for that midi device. If someone can tell me how I can get the names for the cables in my midi device, that would be great. Otherwise, at least I would like to be able to tell what cable number to send to my midi messages.

Code:
port change: 10001803
    connect
  begin reset
port change: 10001005
  port enabled
  end recovery
new_Device: 12 Mbit/sec
new_Pipe
enumeration:
enumeration:
enumeration:
Device Descriptor:
  12 01 00 02 00 00 00 40 44 09 42 01 00 01 01 02 00 01 
    VendorID = 0944, ProductID = 0142, Version = 0100
    Class/Subclass/Protocol = 0 / 0 / 0
    Number of Configurations = 1
enumeration:
enumeration:
Manufacturer: KORG INC.
enumeration:
Product: minilogue xd
enumeration:
Config data length = 115
enumeration:
Configuration Descriptor:
  09 02 73 00 01 01 00 C0 00 
    NumInterfaces = 1
    ConfigurationValue = 1
  09 04 00 00 02 01 03 00 07 
    Interface = 0
    Number of endpoints = 2
    Class/Subclass/Protocol = 1 / 3 / 0
  07 24 01 00 01 43 00 
  06 24 02 01 10 0B 
  09 24 03 02 40 01 10 01 0D 
  06 24 02 01 11 09 
  09 24 03 02 41 01 11 01 00 
  09 24 03 01 30 01 20 01 0A 
  06 24 02 02 20 00 
  09 24 03 01 31 01 21 01 08 
  06 24 02 02 21 00 
  09 05 01 02 40 00 00 00 00 
    Endpoint = 1 OUT
    Type = Bulk
    Max Size = 64
    Polling Interval = 0
  06 25 01 02 10 11 
  09 05 82 02 40 00 00 00 00 
    Endpoint = 2 IN
    Type = Bulk
    Max Size = 64
    Polling Interval = 0
  06 25 01 02 30 31 
enumeration:
USBHub memory usage = 960
USBHub claim_device this=20003220
USBHub memory usage = 960
USBHub claim_device this=200035E0
USBHub memory usage = 960
USBHub claim_device this=200039A0
USBHub memory usage = 960
USBHub claim_device this=20003D60
Descriptor 4 = INTERFACE
MIDIDevice claim this=20004120
len = 106
  bInterfaceClass=1
  bInterfaceSubClass=3
  Interface is MIDI
type: 36, len: 7
subtype: 1
    MIDI Header (ignored)
type: 36, len: 6
subtype: 2
    MIDI IN Jack (ignored)
type: 36, len: 9
subtype: 3
    MIDI OUT Jack (ignored)
type: 36, len: 6
subtype: 2
    MIDI IN Jack (ignored)
type: 36, len: 9
subtype: 3
    MIDI OUT Jack (ignored)
type: 36, len: 9
subtype: 3
    MIDI OUT Jack (ignored)
type: 36, len: 6
subtype: 2
    MIDI IN Jack (ignored)
type: 36, len: 9
subtype: 3
    MIDI OUT Jack (ignored)
type: 36, len: 6
subtype: 2
    MIDI IN Jack (ignored)
type: 5, len: 9
    MIDI Endpoint: 1
      tx_size = 64
type: 37, len: 6
    MIDI Endpoint Jack Association (ignored)
type: 5, len: 9
    MIDI Endpoint: 82
      rx_size = 64
type: 37, len: 6
    MIDI Endpoint Jack Association (ignored)
new_Pipe
new_Pipe
Descriptor 36 =  ???
Descriptor 36 =  ???
Descriptor 36 =  ???
Descriptor 36 =  ???
Descriptor 36 =  ???
Descriptor 36 =  ???
Descriptor 36 =  ???
Descriptor 36 =  ???
Descriptor 36 =  ???
Descriptor 5 = ENDPOINT
Descriptor 37 =  ???
Descriptor 5 = ENDPOINT
Descriptor 37 =  ???
 
Apologies for bumping this again but I need help;

I read the USB MIDI 1.0 specification and tried to make sense of it. Here is what I understand (please don't assume I am using the terms from the spec, consider these real-world terms);
1- Midi devices can have multiple virtual input/output ports, although most of them has 1 input and 1 output. In the case of Korg minilogue xd, there are two inputs and two inputs;
2- In addition to those ports, there are bulk inputs and outputs?? this is not really clear to me but could you please comment on this?

For what I am trying to achieve, I need either of:
1- Just get the cable number for the input port of the device. In the case of korg minilogue xd cable 0 doesn't do it. But I can't keep trying different cable numbers when sending midi, so I need to know before hand, what cable number that device receives midi from.
2- Get the list of virtual midi in and out ports with their names and associated cable numbers

What I understand is that USBhost_t36 doesn't parse these info currently, but I would like to get some help to modify the code to get what I want
 
Back
Top