I’m on Big Sur as well. What I am seeing is:
auto err = CreatorFunctionsToUse::createSource (ump::PacketProtocol::MIDI_1_0, client, name.cfString, &endpoint);
This succeeds and creates a new midi port and places it in endpoint
if (! CHECK_ERROR (MIDIObjectSetIntegerProperty (endpoint, kMIDIPropertyUniqueID, (SInt32) deviceIdentifier)))
This fails, because the ID isn’t unique. And then the function bails out, leaking the endpoint
My “fix” to get me up and running:
for (int i = 0; i < 10; i++)
{
if (CHECK_ERROR (MIDIObjectSetIntegerProperty (endpoint, kMIDIPropertyUniqueID, (SInt32) deviceIdentifier + i)))
break;
if (i == 9)
return {};
}
I’m not sure if you actually want to allow multiple MIDI devices with the same name. I had another program that failed when accessing ports with the same name, so I was just creating a quick test program to generate the ports, since I don’t have two of the same midi devices. I was surprised to see the two ports in the other program, yet get a nullptr
for the second device in juce.