I'm working on getting MIDI input to function in a pretty old Python 2.7 game that uses pygame 1.9.6. The game specifically requires the 'rtmidi' module, but I'm having trouble figuring out exactly which version it needs.
The game's API relies on these specific calls:
- `import rtmidi`
- `.RtMidiOut()`
- `.RtMidiIn()`
- `.getPortCount()`
- `.openPort()`
- `.getMessage()`
This means I can't use 'rtmidi-python' or 'python-rtmidi' since those rely on different methods (.MidiOut and .MidiIn). I've also tried multiple versions of 'rtmidi' that match the API requirements, but the game crashes on startup with a 'TypeError: object of type 'NoneType' has no len()' error.
1 Answer
You might want to check out pyrtmidi on GitHub. It's based on the RtMidi API and seems to fit what you're looking for.
I tried pyrtmidi from PyPI, but the game wouldn't start and gave me a 'TypeError: object of type 'NoneType' has no len()' error.