MIDI Descriptor for USB communication


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1
    Join Date
    Feb 2012
    Posts
    57

    Default MIDI Descriptor for USB communication

    I have been experimenting with MIDI over USB for some time, without much success.
    It seems there is more needed than only a HID descriptor, to have a PIC (18F4550) recognized as a 'MIDI Device'.
    When I connect a commercial MIDI-to-USB interface, Windows 'sees' it as an 'Audio device'.
    Does somebody know of a MIDI descriptor file (that can be used with PicBasic) that will show up the PIC as a MIDI interface?
    In fact I only need PC to PIC communication, but two-way communication is of course also welcome!
    Suggestions are highly appreciated!

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,802

  3. #3
    Join Date
    Feb 2012
    Posts
    57

    Default Re: MIDI Descriptor for USB communication

    Thanks!

    The first link is my previous question, that never received a usable answer. (Although some reactions had good intentions.)

    The second link does not give any code, the code could be obtained upon request, but unfortunately I never received a reaction after mailing him...

  4. #4

    Default Re: MIDI Descriptor for USB communication

    You apparently have or have access to a commercial MIDI-to-USB interface. Several USB monitor will generate a descriptor of a connected device (albeit not in exactly PBP format). I have several installed and if you're interested I will see if any for free/trial one will do that.

    For example USB Device Tree generates this for a Pickit2
    =========================== USB Port1 ===========================

    Connection Status : 0x01 (Device is connected)
    Port Chain : 3-1-2-1

    ======================== USB Device ========================

    +++++++++++++++++ Device Information ++++++++++++++++++
    Device Description : USB Input Device
    Device Path : \\?\usb#vid_04d8&pid_0033#7&2f97cc0d&0&1#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
    Device ID : USB\VID_04D8&PID_0033\7&2F97CC0D&0&1
    Hardware IDs : USB\VID_04D8&PID_0033&REV_0002 USB\VID_04D8&PID_0033
    Driver KeyName : {745a17a0-74d3-11d0-b6fe-00a0c90f57da}\0051 (GUID_DEVCLASS_HIDCLASS)
    Driver : system32\DRIVERS\hidusb.sys (Version: 6.1.7601.17514 Date: 2010-11-21)
    Driver Inf : C:\Windows\inf\input.inf
    Legacy BusType : PNPBus
    Class : HIDClass
    Class GUID : {745a17a0-74d3-11d0-b6fe-00a0c90f57da} (GUID_DEVCLASS_HIDCLASS)
    Interface GUID : {a5dcbf10-6530-11d2-901f-00c04fb951ed} (GUID_DEVINTERFACE_USB_DEVICE)
    Service : HidUsb
    Enumerator : USB
    Location Info : Port_#0001.Hub_#0006
    Location IDs : PCIROOT(0)#PCI(1400)#USBROOT(0)#USB(1)#USB(2)#USB( 1)
    Container ID : {6b462c36-dc86-11e9-b239-f4b7e2dd97cc}
    Manufacturer Info : (Standard system devices)
    Capabilities : 0x84 (Removable, SurpriseRemovalOK)
    Status : 0x0180600A (DN_DRIVER_LOADED, DN_STARTED, DN_DISABLEABLE, DN_REMOVABLE, DN_NT_ENUMERATOR, DN_NT_DRIVER)
    Problem Code : 0
    Power State : D0 (supported: D0, D2, D3, wake from D0, wake from D2)
    Child Device 1 : HID-compliant device
    DevicePath : \\?\hid#vid_04d8&pid_0033#8&cbf5855&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
    KernelName : \Device\00000112
    Device ID : HID\VID_04D8&PID_0033\8&CBF5855&0&0000
    Class : HIDClass

    +++++++++++++++++ Registry USB Flags +++++++++++++++++
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\usbflags\04D800330002
    osvc : REG_BINARY 00 00
    SkipContainerIdQuery : REG_BINARY 00 00 00 00

    ---------------- Connection Information ---------------
    Connection Index : 0x01 (1)
    Connection Status : 0x01 (DeviceConnected)
    Current Config Value : 0x01
    Device Address : 0x1C (28)
    Is Hub : 0x00 (no)
    Device Bus Speed : 0x01 (Full-Speed)
    Number Of Open Pipes : 0x02 (2 pipes to data endpoints)
    Pipe[0] : EndpointID=1 Direction=IN ScheduleOffset=0 Type=Interrupt
    Pipe[1] : EndpointID=1 Direction=OUT ScheduleOffset=0 Type=Interrupt

    ---------------------- Device Descriptor ----------------------
    bLength : 0x12 (18 bytes)
    bDescriptorType : 0x01 (Device Descriptor)
    bcdUSB : 0x200 (USB Version 2.00)
    bDeviceClass : 0x00 (defined by the interface descriptors)
    bDeviceSubClass : 0x00
    bDeviceProtocol : 0x00
    bMaxPacketSize0 : 0x08 (8 bytes)
    idVendor : 0x04D8 (Microchip Technology Inc.)
    idProduct : 0x0033
    bcdDevice : 0x0002
    iManufacturer : 0x01 (String Descriptor 1)
    Language 0x0409 : "Microchip Technology Inc."
    iProduct : 0x02 (String Descriptor 2)
    Language 0x0409 : "PICkit 2 Microcontroller Programmer"
    iSerialNumber : 0x03 (String Descriptor 3)
    Language 0x0409 : "Љ"
    bNumConfigurations : 0x02 (2 Configurations)

    ------------------ Configuration Descriptor -------------------
    bLength : 0x09 (9 bytes)
    bDescriptorType : 0x02 (Configuration Descriptor)
    wTotalLength : 0x0029 (41 bytes)
    bNumInterfaces : 0x01 (1 Interface)
    bConfigurationValue : 0x01 (Configuration 1)
    iConfiguration : 0x02 (String Descriptor 2)
    Language 0x0409 : "PICkit 2 Microcontroller Programmer"
    bmAttributes : 0x80
    D7: Reserved, set 1 : 0x01
    D6: Self Powered : 0x00 (no)
    D5: Remote Wakeup : 0x00 (no)
    D4..0: Reserved, set 0 : 0x00
    MaxPower : 0x32 (100 mA)

    ---------------- Interface Descriptor -----------------
    bLength : 0x09 (9 bytes)
    bDescriptorType : 0x04 (Interface Descriptor)
    bInterfaceNumber : 0x00
    bAlternateSetting : 0x00
    bNumEndpoints : 0x02 (2 Endpoints)
    bInterfaceClass : 0x03 (HID - Human Interface Device)
    bInterfaceSubClass : 0x00 (None)
    bInterfaceProtocol : 0x00 (None)
    iInterface : 0x00 (No String Descriptor)

    ------------------- HID Descriptor --------------------
    bLength : 0x09 (9 bytes)
    bDescriptorType : 0x21 (HID Descriptor)
    bcdHID : 0x0001 (HID Version 0.01)
    bCountryCode : 0x00 (00 = not localized)
    bNumDescriptors : 0x01
    Descriptor 1:
    bDescriptorType : 0x22 (Class=Report)
    wDescriptorLength : 0x001D (29 bytes)
    Error reading descriptor : ERROR_GEN_FAILURE

    ----------------- Endpoint Descriptor -----------------
    bLength : 0x07 (7 bytes)
    bDescriptorType : 0x05 (Endpoint Descriptor)
    bEndpointAddress : 0x81 (Direction=IN EndpointID=1)
    bmAttributes : 0x03 (TransferType=Interrupt)
    wMaxPacketSize : 0x0040 (64 bytes)
    bInterval : 0x01 (1 ms)

    ----------------- Endpoint Descriptor -----------------
    bLength : 0x07 (7 bytes)
    bDescriptorType : 0x05 (Endpoint Descriptor)
    bEndpointAddress : 0x01 (Direction=OUT EndpointID=1)
    bmAttributes : 0x03 (TransferType=Interrupt)
    wMaxPacketSize : 0x0040 (64 bytes)
    bInterval : 0x01 (1 ms)

    ------------------ Configuration Descriptor -------------------
    bLength : 0x09 (9 bytes)
    bDescriptorType : 0x02 (Configuration Descriptor)
    wTotalLength : 0x0029 (41 bytes)
    bNumInterfaces : 0x01 (1 Interface)
    bConfigurationValue : 0x01 (Configuration 1) *!*ERROR: Configuration 1 is defined more than once
    iConfiguration : 0x02 (String Descriptor 2)
    Language 0x0409 : "PICkit 2 Microcontroller Programmer"
    bmAttributes : 0x80
    D7: Reserved, set 1 : 0x01
    D6: Self Powered : 0x00 (no)
    D5: Remote Wakeup : 0x00 (no)
    D4..0: Reserved, set 0 : 0x00
    MaxPower : 0x32 (100 mA)

    ---------------- Interface Descriptor -----------------
    bLength : 0x09 (9 bytes)
    bDescriptorType : 0x04 (Interface Descriptor)
    bInterfaceNumber : 0x00
    bAlternateSetting : 0x00
    bNumEndpoints : 0x02 (2 Endpoints)
    bInterfaceClass : 0x03 (HID - Human Interface Device)
    bInterfaceSubClass : 0x00 (None)
    bInterfaceProtocol : 0x00 (None)
    iInterface : 0x00 (No String Descriptor)

    ------------------- HID Descriptor --------------------
    bLength : 0x09 (9 bytes)
    bDescriptorType : 0x21 (HID Descriptor)
    bcdHID : 0x0001 (HID Version 0.01)
    bCountryCode : 0x00 (00 = not localized)
    bNumDescriptors : 0x01
    Descriptor 1:
    bDescriptorType : 0x22 (Class=Report)
    wDescriptorLength : 0x001D (29 bytes)
    Error reading descriptor : ERROR_GEN_FAILURE

    ----------------- Endpoint Descriptor -----------------
    bLength : 0x07 (7 bytes)
    bDescriptorType : 0x05 (Endpoint Descriptor)
    bEndpointAddress : 0x81 (Direction=IN EndpointID=1)
    bmAttributes : 0x03 (TransferType=Interrupt)
    wMaxPacketSize : 0x0040 (64 bytes)
    bInterval : 0x01 (1 ms)

    ----------------- Endpoint Descriptor -----------------
    bLength : 0x07 (7 bytes)
    bDescriptorType : 0x05 (Endpoint Descriptor)
    bEndpointAddress : 0x01 (Direction=OUT EndpointID=1)
    bmAttributes : 0x03 (TransferType=Interrupt)
    wMaxPacketSize : 0x0040 (64 bytes)
    bInterval : 0x01 (1 ms)

    ----------------- Device Qualifier Descriptor -----------------
    Error : ERROR_GEN_FAILURE

    -------------------- String Descriptors -------------------
    ------ String Descriptor 0 ------
    bLength : 0x04 (4 bytes)
    bDescriptorType : 0x03 (String Descriptor)
    Language ID[0] : 0x0409 (English - United States)
    ------ String Descriptor 1 ------
    bLength : 0x34 (52 bytes)
    bDescriptorType : 0x03 (String Descriptor)
    Language 0x0409 : "Microchip Technology Inc."
    ------ String Descriptor 2 ------
    bLength : 0x48 (72 bytes)
    bDescriptorType : 0x03 (String Descriptor)
    Language 0x0409 : "PICkit 2 Microcontroller Programmer"
    ------ String Descriptor 3 ------
    bLength : 0x04 (4 bytes)
    bDescriptorType : 0x03 (String Descriptor)
    Language 0x0409 : "Љ"
    Last edited by towlerg; - 28th November 2019 at 14:50.
    George

  5. #5
    Join Date
    Feb 2012
    Posts
    57

    Default Re: MIDI Descriptor for USB communication

    Wow, that is a lot of (probably) useful information!
    The next question is: how to generate a descriptor file from this...
    Thanks!

    By the way: I saw HIDmaker Pro. That looks like an interesting (but expensive!) product for USB development.
    A disadvantage is that there is not very much information about it, or even an evaluation version.
    Last edited by RuudNL; - 28th November 2019 at 15:14.

  6. #6
    Join Date
    Aug 2011
    Posts
    408

    Default Re: MIDI Descriptor for USB communication

    By the way: I saw HIDmaker Pro
    I'd be hard pressed to justify $400 for a tool that generates what you can basically get for free.
    There are lots of examples out there (just not for PBP).

    Besides, it's HID only. Wouldn't help much with what you're looking for.

Similar Threads

  1. MIDI over USB
    By RuudNL in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 11th November 2017, 23:33
  2. 2 Axes USB HID Descriptor problem
    By TronicBrain in forum USB
    Replies: 2
    Last Post: - 18th March 2014, 05:06
  3. MIDI over USB peripheral
    By aberco in forum USB
    Replies: 1
    Last Post: - 31st October 2011, 16:06
  4. MIDI to USB
    By DaveC3 in forum USB
    Replies: 0
    Last Post: - 31st March 2011, 21:38
  5. USB to MIDI module
    By Coco Sapone in forum Adverts
    Replies: 0
    Last Post: - 23rd October 2010, 18:13

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

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