You are on the editable version of MDN Web Docs

MDN 웹 문서 사용자로 보기: https://developer.mozilla.org/ko/docs/Web/API/MIDIAccess

이 문서는 아직 자원 봉사자들이 한국어로 번역하지 않았습니다. 참여해서 번역을 마치도록 도와 주세요!
English (US)의 문서도 읽어보세요.

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

 

The MIDIAccess interface of the Web MIDI API provides methods for listing MIDI input and output devices, and obtaining access to those devices.

Properties

MIDIAccess.inputs Read only
Returns an instance of MIDIInputMap which provides access to any available MIDI input ports.
MIDIAccess.outputs Read only
Returns an instance of MIDIOutputMap which provides access to any available MIDI output ports.
MIDIAccess.sysexEnabled Read only
A boolean attribute indicating whether system exclusive support is enabled on the current MIDIAccess instance.

Event Handlers

MIDIAccess.onstatechange
Called whenever a new MIDI port is added or an existing port changes state.

Examples

navigator.requestMIDIAccess()
  .then(function(access) {

     // Get lists of available 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);
     };
  });

Specifications

Specification Status Comment
Web MIDI API Working Draft Initial definition.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
MIDIAccess
Experimental
Chrome Full support 43Edge Full support ≤79Firefox No support NoIE No support NoOpera Full support 33Safari No support NoWebView Android Full support 43Chrome Android Full support 43Firefox Android ? Opera Android Full support 33Safari iOS No support NoSamsung Internet Android Full support 4.0
inputs
Experimental
Chrome Full support 43Edge Full support ≤79Firefox No support NoIE No support NoOpera Full support YesSafari No support NoWebView Android Full support 43Chrome Android Full support 43Firefox Android ? Opera Android Full support YesSafari iOS No support NoSamsung Internet Android Full support 4.0
outputs
Experimental
Chrome Full support 43Edge Full support ≤79Firefox No support NoIE No support NoOpera Full support YesSafari No support NoWebView Android Full support 43Chrome Android Full support 43Firefox Android ? Opera Android Full support YesSafari iOS No support NoSamsung Internet Android Full support 4.0
statechange event
Experimental
Chrome Full support 43Edge Full support ≤79Firefox No support NoIE No support NoOpera ? Safari No support NoWebView Android Full support 43Chrome Android Full support 43Firefox Android ? Opera Android ? Safari iOS No support NoSamsung Internet Android Full support 4.0
sysexEnabled
Experimental
Chrome Full support 45Edge Full support ≤79Firefox No support NoIE No support NoOpera Full support YesSafari No support NoWebView Android Full support 45Chrome Android Full support 45Firefox Android ? Opera Android Full support YesSafari iOS No support NoSamsung Internet Android Full support 5.0

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.

문서 태그 및 공헌자

최종 변경자: mdnwebdocs-bot,