-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Device enumeration #1
Comments
I've definitely been thinking about this recently but haven't had time to sit down and actually implement something. I also think that an API for enumerating devices seems very reasonable, but would prefer a different name than Open. Maybe List() ? Thus far I've just been using |
I was also digging more into this package and it seems like it's kind of limited when it comes to devices with multiple ports, that is, it always opens the first one. That should be more flexible as well. I also think it's a good idea to separate input and output ports in the API. Some devices will have only outputs, or some only inputs, and I think it doesn't really make sense to expose methods that they can't support. It also complicates matters for devices that have a more complicated collection of input and output ports, where they may not be paired in an obvious way. I don't really think providing substring matching right in the package is necessarily a good idea, because naming of ports can be different depending on the system configuration or vendor implementation of MIDI-USB. I think it's better for users to be able to decide what the best way to choose the device is. Maybe what you propose is as far as you'd like to go in this package, but I'd really like to develop a canonical MIDI package for Go that can support even the most complex use cases. |
I agree this package is very limited right now. That is intentional. If you have a need for more granular control over which ports are used for a given device that also seems like a separate issue, I created this #2 I think you're right that the device discovery probably doesn't belong in this package. Maybe that's why I've been slow to start coding it! |
I will have a play with the API at home and see what I can come up with. I have a pretty complex setup in my studio with 30+ MIDI endpoints that will make a pretty good test case. |
I took a look at the portmidi code for populating the device list with Alsa Sequencer. |
Figured I would discuss this here instead of the portmidi repo :) But one important thing missing from the API right now is a way to enumerate devices. Have you thought about what the API would look like for that?
It would be nice if the enumeration returned a slice of devices that had the Open method directly on them, instead of say an ID that then needs to be passed to an Open function.
The text was updated successfully, but these errors were encountered: