--- title: MIDIAccess slug: Web/API/MIDIAccess translation_of: Web/API/MIDIAccess ---
{{SeeCompatTable}}{{APIRef("Web MIDI API")}}
The MIDIAccess
interface van de Web MIDI API geeft u methodes om aangesloten MIDI in- en uitgangen weer te geven en te ondervragen.
navigator.requestMIDIAccess() .then(function(access) { // Geef een lijst van aangesloten MIDI controllers const inputs = access.inputs.values(); const outputs = access.outputs.values(); access.onstatechange = function(e) { // Print information about the (dis)connected MIDI controller console.log(e.port.name, e.port.manufacturer, e.port.state); }; });
Specification | Status | Comment |
---|---|---|
{{SpecName('WebMIDI API','#midiaccess-interface')}} | {{Spec2('WebMIDI API')}} | Initial definition. |
{{Compat("api.MIDIAccess")}}