scgolang / midi

Golang midi package
13 stars 0 forks source link

Control which ports are opened #2

Open briansorahan opened 7 years ago

briansorahan commented 7 years ago

Idea spawned from this discussion https://github.com/scgolang/midi/issues/1 This would allow users to have more control over which ports they use.

kisielk commented 7 years ago

I don't think opening all the ports is necessarily a good idea, it uses up unnecessary resources and I think some systems like Windows only allow a port to be opened once. However exposing all the ports to the user of the package and allowing them to choose which one to open would be good.

briansorahan commented 7 years ago

I looked at how to do this with alsa rawmidi (which I prefer over the more complicated sequencer interface). It looks like all you can do is open a given device and either open just an input, just an output, or both http://www.alsa-project.org/alsa-doc/alsa-lib/group___raw_midi.html#ga2ab783051deeb7eb37eb568b76448889 I don't think CoreMIDI is limited in this way, but if this package supports both then alsa rawmidi might be the limiting factor. My understanding of alsa rawmidi could also be incomplete

briansorahan commented 7 years ago

@kisielk How about flags to control which ports are opened? I'm open to suggestion on what this issue should be about.

Based on what I know about alsa we might be limited to

FlagOpenInput
FlagOpenOutput

I'm not sure how to with a device that had multiple ins/outs using alsa rawmidi