I'm currently working on an old Python 2.7 game that uses pygame 1.9.6 and I need to get MIDI input functioning. The game specifically requires the 'rtmidi' module, but I'm having difficulty pinpointing the exact version it needs. The API calls in the game include `import rtmidi`, `.RtMidiOut()`, `.RtMidiIn()`, `.getPortCount()`, `.openPort()`, and `.getMessage()`. These function names eliminate options like 'rtmidi-python' and 'python-rtmidi', since they use `.MidiOut` and `.MidiIn` instead. I've tried multiple versions of 'rtmidi' that match the expected API but keep facing a crash on startup with the error message `TypeError: object of type 'NoneType' has no len()`. Any ideas on where I can find the right 'rtmidi' version?
1 Answer
You might want to check out this repository: https://github.com/patrickkidd/pyrtmidi. I found it while looking for `RtMidiOut()`, and it could be the one you're looking for.

I did try that one, but it’s listed as `rtmidi` on PyPI. I installed it both via pip and built it from source, but unfortunately, the game still fails to start with that `NoneType` error.