EventEmitter.ANY_EVENT #234
-
Is there a way to listen to all midi events on a particular port, channel or globally? I have found this page in the docs: EventEmitter.ANY_EVENT This sounds like what I want, but how do I use it? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
There is currently no way to listen to all MIDI messages globally. You could, however, add a listener for This is how to do it at the WebMidi.inputs.forEach(input => {
input.addListener("midimessage", e => console.log(e));
}); The difference between listening for |
Beta Was this translation helpful? Give feedback.
There is currently no way to listen to all MIDI messages globally. You could, however, add a listener for
midimessage
to allInput
orInputChannel
objects.This is how to do it at the
Input
level:The difference between listening for
midimessage
and listening forEventEmitter.ANY_EVENT
is that the former is only triggered when a MIDI message is received while the latter is triggered by MIDI messages and other events such asopened
,closed
anddisconnected
.