1

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?

Hello World
  • 1,102
  • 2
  • 15
  • 33
  • Weird. Works for me. (Chrome 63.0.3239.70 on OSX.) – cwilso Dec 09 '17 at 18:34
  • Works, too. Windows 10 (Chrome 63.0.3239.84 ) – Kilian Hertel Dec 13 '17 at 23:14
  • What is `keys` referring to in your code? It looks like you're trying to respond to a MIDI input message by sending a MIDI message somewhere else, presumably a MIDI output device? I took your code here and updated it to log to the console instead and it works as expected: https://jsfiddle.net/k24Lx2uv/7/ – George Mandis Mar 11 '18 at 18:47

0 Answers0