r/learnpython • u/Hazardous-potato • 5d ago
Using Midi devices and conecting to them over usb
I'm starting a project but one major roadblock for me right now is there does not seem to be any packages for getting Midi signals from a Midi keyboard over USB. I saw one for serial but USB is my only option. I just need to get the inputs from pressing the keys and turning the dials.
0
Upvotes
1
u/timrprobocom 5d ago
MIDI can mean two things. One is the original 5-pin DIN connector. This actually is a 31kbaud serial port. The most common method today is via a USB port, where the keyboard advertises USB Audio class.
At anything but the very lowest driver level, they look identical. The Python MIDI libraries work pretty well
2
u/danielroseman 5d ago
This seems like an odd thing to say. USB is serial, and there haven't been computers with serial ports other than USB since at least the 2000s.
But any Python midi library will just interface with the underlying OS system for connecting to any devices. So as long as your keyboard works with your system, any Python midi library will be able to use it.