STM32f103MIDI driver midi in, how can MIDI input be supported

Post here first, or if you can't find a relevant section!
Post Reply
517002650
Posts: 12
Joined: Mon Jul 10, 2023 10:37 pm

STM32f103MIDI driver midi in, how can MIDI input be supported

Post by 517002650 »

STM32f103MIDI driver midi in, how can I support MIDI input? After looking at the example, I still don't know how to operate it. Can anyone help me? Thank you! Instance Link

https://github.com/rogerclarkmelbourne/ ... /USBMIDI.h
https://github.com/rogerclarkmelbourne/ ... midiin.ino
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: STM32f103MIDI driver midi in, how can MIDI input be supported

Post by ag123 »

the original author and repository is probably here
https://github.com/arpruss/USBComposite_stm32f1
viewtopic.php?p=11468&hilit=composite#p11468

there is a pretty old spec for MIDI here
https://www.usb.org/sites/default/files/midi10.pdf
I'm not sure if MIDI is conforming to that spec or some other implementations that has evolved over time and that is actually informal, i.e. there is no spec, but just that some (well known) companies did their MIDI in a particular way, and others reversed engineered the protocol, possibly based on HID.

there is another very large class that we casually denoted as HID - commonly used for keyboards and mouse
the page about it is here
https://www.usb.org/hid
the HID class device spec is here
https://www.usb.org/document-library/de ... on-hid-111

and highly related to HID is the usage tables is here:
https://usb.org/document-library/hid-usage-tables-14
the list of usages is *huge*, and I don't think 'standard' drivers on the desktop side support them all.
only the most common e.g. keyboard and mouse is supported, and maybe some others

I casually did some searches in the usage tables for 'MIDI' as a keyword and found nothing there.
i.e. MIDI use of HID is potentially custom and proprietary. and that some of the implementations found floating out there is potentially reversed engineered if it is done by a 3rd party and that it use HID.

for HID the starting point is to understand the HID device class specs, it is a pretty steep learning curve.
e.g. that for a keyboard (the standard computer keyboard), the report descriptors describe how the inputs and outputs are structured.
and that the inputs and outputs are linked to the *usage tables*, for specific usages e.g. computer keyboards and/or mouse, there are standard usage tables. This is so that if the device (e.g. your board) sends codes as specified and according to the usage tables. Maybe the driver in the host (e.g. Windows) would recognize it and treat it as keys presses sent from the keyboard, or button presses from the mouse etc.

Those are actually beyond what is normally in the scope of 'stm32duino'.

and that I'd just like to say that support for even 'standard' USB devices classes is not necessary always 'standard' in the OS.
i.e. that some custom drivers and/or app is likely required. E.g. Microsoft mentions what they support
https://learn.microsoft.com/en-us/windo ... sb-classes
Post Reply

Return to “General discussion”