Partial device name matching

Currently, on Windows (and whenever scsynth is built with PortAudio backend), partial device names are matched with the known device. On macOS, partial device name has the same result as providing an incorrect one (and the default one is selected).

Should we change this behavior on macOS to allow providing partial device name?

No, I don’t think it should change. Partial mapping can be done by sclang. If you put it into the low level, then there is never a way to match absolutely.

In fact, it would be better to change the other way: Make all port names match only identically in C++ layer - and move partial mapping to a utility in sclang.

For example, you can see my port name matching code in my clockwise MIDI library in the function midiDevice on github.

Partial audio device name matching, in Windows, can’t be done by sclang because sclang in Windows can’t retrieve a list of audio devices. There’s an enhancement request for it but nobody has worked on it AFAIK.

hjh

I am just wondering in what situation, when providing a partial name, user would prefer selection of default audio device (current macOS behavior) vs. the one that partially matches the name.

I understand though that by putting this in the server we have no easy way of turning it off. But I still fail to conceptualize when is it practical to only exact match the device name.

It depends on the details of the partial match algo. But here’s the principle I think I user expects:

If my set up works, then adding another MIDI device, no matter how the device chooses its name, should not change my set up when re-run.

In my experience, device manufacturers have “interesting” ideas about what their MIDI ports should be named… and it can change depending on the mode the device is in! Also, adding multiples of a device leads to other naming issues. What I don’t want is for those situations to lead to the wrong device getting connected because the partial match choose something different in the face of the newer ports.

For the record - I don’t think selecting the “default” device when the name fails is a good semantic.