function sendMiddleC(midiAccess, portID) {
const noteOnMessage = [0x90, 60, 0x7f]; // note on, middle C, full velocity
const output = midiAccess.outputs.get(portID);
output.send(noteOnMessage); // sends the message.
}MIDIOutput / notebook
MIDIOutput
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.