web-midi

Prevent event from being fired when sending a midi message


When I send a midi message on an output port it causes an event being fired by my input ports. Is this expected behaviour or is this because I use the IAC driver and the output gets wired back into the IAC driver input?

let output = midiAccess.outputs.get(portID)
output.send(action.data)

navigator.requestMIDIAccess({sysex: true})
  .then((midiAccess) => {
    midiAccess.inputs.forEach((entry) => {
      entry.onmidimessage = (event) => {
        dispatch(midiMessage(event))
      }
    })
  })

Solution

  • I answered at a different place, but let me explain here too.

    What IAC means is "Inter-application communication". The driver is designed to communicate between applications, as one can send MIDI messages via output port, and the other can receive them via input port. This is an IAC specific feature and behavior. You can not expect this for other virtual or physical devices.

    On Linux, ALSA provides similar pass through devices. Also, you may be able to find a similar driver for Windows. Or you can even connect traditional MIDI output/input ports each other physically through a DIN cable.