Web midi/audio: Why is onmidimessage not firing?

325 views Asked by At

I am using the following code with cotejp's webmidi library to detect midi input events:

  WebMidi.enable(() => {
    WebMidi.inputs.forEach((input) => {
      input.addListener('noteon', 'all', (e)=>keys.noteOn(e));
      input.addListener('noteoff', 'all', (e)=>keys.noteOff(e));
      input.addListener('controlchange', 'all', this.controlChange);
    });
    resolve(WebMidi.inputs);
  });

For some reason this has stopped working. I couldn't figure out why so I tried creating an implementation which uses no libraries:

https://jsfiddle.net/kbmhwnrh/

All midi inputs are detected and opened successfully but onmidimessage does nothing. I have tried on multiple computers using multiple midi devices and have the same result. What am I missing?

0

There are 0 answers