Skip to content
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

Input/Output device mapping #239

Open
chrisguttandin opened this issue Dec 23, 2022 · 2 comments
Open

Input/Output device mapping #239

chrisguttandin opened this issue Dec 23, 2022 · 2 comments
Labels
class: substantive https://www.w3.org/2023/Process-20230612/#correction-classes MIDI2 https://www.midi.org/specifications/midi-2-0-specifications
Milestone

Comments

@chrisguttandin
Copy link

MIDI-CI messages require a bi-directional communication with MIDI devices. As far as I can tell there is currently no way to map an input device with its corresponding output device with WebMIDI. Unfortunately a typical MIDI-CI message flow requires this mapping.

midiOutputDevice.send(/* a MIDI-CI query message */)
midiInputDevice.onmessage = (event) => { /* a MIDI-CI response message */ };

The problem is that there is currently no way to know which midiInputDevice will receive the response when sending something to a particular midiOutputDevice.

Most devices use similar names which makes it is easy for humans to map them. But I guess this is error prone since the names are different from operating system to operating system and a list of mapped devices would be very difficult to maintain.

MIDI-CI messages also contain a MIDI Negotiation Identifier (MIND) which is unique and would allow to map responses with query messages. But in order to do that one would have to listen to all MIDI input devices to capture each and every message just to find the one device that answers.

Maybe it's an options to add something similar to the groupId of a MediaDeviceInfo object which identifies physical devices.

interface MIDIPort {
  readonly attribute DOMString groupId;
};
@raveslave
Copy link

the best would be to expose the usb-devices and port structure

@hoch hoch added the MIDI2 https://www.midi.org/specifications/midi-2-0-specifications label Mar 23, 2023
@mjwilson-google
Copy link
Contributor

See also #148

@mjwilson-google mjwilson-google added the class: substantive https://www.w3.org/2023/Process-20230612/#correction-classes label Sep 13, 2023
@mjwilson-google mjwilson-google added this to the future-work milestone Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
class: substantive https://www.w3.org/2023/Process-20230612/#correction-classes MIDI2 https://www.midi.org/specifications/midi-2-0-specifications
Projects
None yet
Development

No branches or pull requests

4 participants