20211219_003_web_midi/sketch.js
// Function triggered when WebMidi.js is ready
Function triggered when WebMidi.js is ready
Function triggered when WebMidi . js is ready
function onEnabled() {
  if (WebMidi.inputs.length < 1) {
    document.body.innerHTML += "No device detected.";
  } else {
    WebMidi.inputs.forEach((device, index) => {
      document.body.innerHTML += `${index}: ${device.name} <br>`;
    });
  }
}
function onEnabled ( ) { if ( WebMidi . inputs . length < 1 ) { document . body . innerHTML += "No device detected." ; } else { WebMidi . inputs . forEach ( ( device , index ) => { document . body . innerHTML += ` ${ index } ${ device . name } ` ; } ) ; } }
Function triggered when WebMidi.js is ready
Function triggered when WebMidi . js is ready
// Display available MIDI input devices