djipco / webmidi

Tame the Web MIDI API. Send and receive MIDI messages with ease. Control instruments with user-friendly functions (playNote, sendPitchBend, etc.). React to MIDI input with simple event listeners (noteon, pitchbend, controlchange, etc.).
Apache License 2.0
1.53k stars 115 forks source link

typescipt `ControlChangeMessageEvent` includes `{ channel: number }` which is actually undefined. #427

Closed xinaesthete closed 1 month ago

xinaesthete commented 1 month ago

Description This appears with auto-completion etc and can lead to writing something like e.channel === channel rather than e.message.channel === channel.

Environment: "webmidi": "^3.1.9" as freshly installed via npm. Browser ESM, Vite, TS, React etc.

djipco commented 1 month ago

Good catch! Thanks for reporting. Fixed in release 3.1.10.