D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
MAKIO135
Full window
Github gist
webMIDI
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Hello WebMIDI</title> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <script> navigator.requestMIDIAccess() .then(onMIDISuccess, onMIDIFailure); function onMIDISuccess(midiAccess) { for (var input of midiAccess.inputs.values()){ input.onmidimessage = getMIDIMessage; } } function getMIDIMessage(midiMessage) { var command = midiMessage.data[0]; var note = midiMessage.data[1]; var velocity = (midiMessage.data.length > 2) ? midiMessage.data[2] : 0; console.log({command,note,velocity}); } function onMIDIFailure() { console.log('Could not access your MIDI devices.'); } </script> </body> </html>