Closed mojca closed 1 year ago
Oh, I'm sorry. It looks like I'm looking at the wrong project. I thought it was weird that I didn't find the file rtmidi_python.cpp
anywhere inside the sources.
I just wanted to get https://github.com/josephernest/SamplerBox working and while this project seems a lot more active than the other one (and it installs out of the box), I would need to port the code of samplerbox first if I wanted to use this one.
At least for the SamplerBox
, porting the code to make it work with python-rtmidi
surprisingly seemed relatively trivial. Apart from the import name (and further changes to support python 3) I needed to do just one tiny change in the source:
midi_in = [rtmidi.MidiIn()]
previous = []
while True:
- for port in midi_in[0].ports:
+ for port in midi_in[0].get_ports():
if port not in previous and 'Midi Through' not in port:
midi_in.append(rtmidi.MidiIn())
midi_in[-1].callback = MidiCallback
midi_in[-1].open_port(port)
print('Opened MIDI:', port)
- previous = midi_in[0].ports
+ previous = midi_in[0].get_ports()
time.sleep(2)
Would it perhaps be possible to support the syntax .ports
in addition to .get_ports()
in your library? It sounds a lot more "pythonic" that way and it might make life of other ports easier at the same time.
I'm trying to install
rtmidi_python
on Windows for Python 3.10 without success. It would probably help if the wheel was available out of the box.