Python-rtmidi renumberation from time to time / looking for solution / maybe a feature request :)

Hello everyone!

First, a big compliment to Jean-Emmanuel. OSC is a fantastic software and I am really grateful to have found the project. I have been building an OSC interface for my Cubase orchestra template for the last few months. So far I have been able to solve all the challenges, but one topic drives me crazy.

The assignment of the midi ports via python-rtmidi. My setup includes various external devices (keyboards, midi controllers, etc.). In some cases the start works without problems. But it happens from time to time that python-rtmidi renumbers the ports. This seems to be partly dependent on the switch-on sequence, but sometimes it also occurs without any apparent reason.

Does anyone have a solution for this problem? I think one possibility would be for OSC to search the list of ports at startup and assign them by name. In most cases the names do not change. Maybe Jean-Emmanuel could implement that option in a upcoming release?

BR Joe

Hello everyone,

nobody has a hint for me?

@jean-emmanuel
Perhaps it would be possible for you to have a look at the topic? According to the documentation of rtmidi the passing of a name as parameter is generally possible.

That would be really helpful. Thanks a lot.


rtmidi.midiutil.open_midiport(port=None, type_=‘input’, api=0, use_virtual=False, interactive=True, client_name=None, port_name=None)[source]

    Open MIDI port for input or output and return MidiIn/MidiOut instance.

    Arguments:

    port

        A MIDI port number or (substring of) a port name or None.

        Available ports are enumerated starting from zero separately for input and output ports. If only a substring of a port name is given, the first matching port is used.

   [..]

BR Joe

Hi,
I did read the topic and already did some tinkering, it should be possible.

1 Like

Thank you very much. Let me know if I can help with any tests for you.

v1.0.3 is building/uploading, the change is documented here : https://openstagecontrol.ammd.net/docs/midi/midi-configuration/#configuration

1 Like

Thank you @jean-emmanuel!

It’s working perfectly. All ports have been allocated correctly. This helps me significantly with the availability. Just in case you missed it up there: I love OSC! It is a fabulous piece of software.

BR Joe

Thanks ! :slight_smile:

1 Like