-
Notifications
You must be signed in to change notification settings - Fork 51
Higher-level MIDI message access #179
Copy link
Copy link
Open
Labels
Needs DiscussionThe issue needs more discussion before it can be fixed.The issue needs more discussion before it can be fixed.Priority: Eventuallyhttps://speced.github.io/spec-maintenance/about/https://speced.github.io/spec-maintenance/about/category: new featurehttps://www.w3.org/policies/process/#class-4https://www.w3.org/policies/process/#class-4
Milestone
Metadata
Metadata
Assignees
Labels
Needs DiscussionThe issue needs more discussion before it can be fixed.The issue needs more discussion before it can be fixed.Priority: Eventuallyhttps://speced.github.io/spec-maintenance/about/https://speced.github.io/spec-maintenance/about/category: new featurehttps://www.w3.org/policies/process/#class-4https://www.w3.org/policies/process/#class-4
Currently, MIDI messages are delivered as events containing short arrays of bytes. This means the script author needs to write a function to parse and handle them. For example, the
simple monophonic synthexample in the spec hasfunction MIDIMessageEventHandler(event)which masks off the channel info and then handles note-on and note-off.Parsing is not as simple as it might appear. For example, The LSB MIDI CCs need t have their values stored, and those values read, combined with MSB, and set to zero when the corresponding MSB CCs are encountered. System Realtime events can occur interleaved in other messages.
Thus, it seems likely that a succession of incomplete, poorly-conformant parsers will proliferate by copy paste in each WebMIDI-using script.
This situation could of course be alleviated by script libraries which provide a better parser. However, it could also be useful to save developers the trouble (and reduce fragmentation and the need to load third-party libraries) by offering a higher-level MIDI message access. this would be in addition to the existing low-level access. For example, a developer could register a callback for NoteOn, without having to remember what the message byte value is, and without having to handle zero velocity or HRVelocity prefix.