Web MIDI

making browser music

Eric Wood

@eric_b_wood

Frontendgineer @ Blue Apron

 

Title Text

Subtitle

Requesting MIDI Access

if(navigator.requestMIDIAccess) {
  navigator.requestMIDIAccess().then(success, failure);
}

function success(midiAccess) {
  // do some cool MIDI stuff now heck yes
};

function failure() {
  console.error("Welp, this is awkward...");
};

Do some cool MIDI STuff now heck yes

midiAccess.inputs  // Map of input devices
midiAccess.outputs // Map of output devices
input = {
  connection:   "closed"
  id:           "-1591518671"
  manufacturer: "KORG INC."
  name:         "minilogue MIDI IN"
  state:        "connected"
  type:         "input"
  version:      "2"
}
output = {
  connection:   "closed"
  id:           "-415611304"
  manufacturer: "KORG INC."
  name:         "minilogue MIDI OUT"
  state:        "connected"
  type:         "output"
  version:      "2"
}

reading

MIDI

By Eric Wood