Open lkamp opened 1 year ago
Actually Midi Ports are two dimensional in Linux (ALSA) and each dimension may change independently. Flat port numbers change as soon as a device with a lower ALSA device number will change its number of ports. This may happen more often with software MIDI devices. The string representation is slightly better.
You could try
outJucePtr = MidiOutput::openDevice (getProperty(Ids::midiDevId).toString()).release();
and
inJucePtr = MidiInput::openDevice (getProperty(Ids::midiDevId).toString(), this).release();
midiDevId is implemented in https://github.com/keinstein/ctrlr/tree/dehnhardt_midichanges which is based on https://github.com/RomanKubiak/ctrlr/pull/151 Could you try it, please? If @dehnhardt agrees I could make a pull request for that.
I don't mind.
I built from source on Arch Linux, version 5.6.0, downloaded from the GitHub releases page.
Opening a MIDI device always failed. I fixed the issue by changing CtrlrMIDIDevice.cpp line 54 from
outJucePtr = MidiOutput::openDevice (getProperty(Ids::midiDevIndex).toString()).release();
to
outJucePtr = MidiOutput::openDevice ((int)getProperty(Ids::midiDevIndex)).release();
Same thing has to be done on line 75 to open MIDI input.
This was only tested on current version of Arch Linux. No guarantee that it works on all platforms.