Skip to Content
Platform.Ontology

Web MIDI (midi and midi sysex)

Asks to talk to connected music gear such as keyboards and controllers.

Asks you firstHardware and accessoriesPeripheralsWeb browsersWhile you use it

In one line

Can talk to your connected music gear, with a prompt for deeper control

Asks to talk to connected music gear such as keyboards and controllers.

Two permission levels: plain MIDI sees note and control data; sysex also sends vendor system messages that can reprogram a device. Reveals which music devices you own.

What it can and can't do

What the user does: You tap Connect keyboard or Connect MIDI on a music site.

It can

  • Listen to notes from a keyboard or controller you have plugged in
  • Send notes and lights to the device
  • Ask for deeper control, called sysex, that shows a stronger warning

It cannot

  • Use any music gear before you allow it
  • Change the gear's settings with sysex unless you allow that
  • Work in Safari or on iPhone
  • Keep access after you clear permissions or close the site

How it differs between platforms: Chrome, Edge and Firefox support it. Firefox may need an add on for sysex. Safari and iPhone do not.

Browser support

BrowserStatusFirst versionReleasedNote
ChromeSupported432015-05-19None
EdgeSupported792020-01-15None
FirefoxSupported1082022-12-13Add-on required in 108
SafariNot supportedNot availableNot listedNone
Safari on iPhoneNot supportedNot availableNot listedNone
Chrome on AndroidSupported432015-05-27None
Samsung InternetSupported4.02016-03-11None

How a site asks for it

APInavigator.requestMIDIAccess({sysex}); permission midi with descriptor {sysex:true}
Permission namemidi
Permissions policymidi
Browser compat keysapi.Navigator.requestMIDIAccess
How access is grantedprompt
What the user seesChromium prompt: Control and reprogram your MIDI devices when sysex is requested; Chrome 124 prompts for any MIDI access. Firefox 108 needs an add-on install for sysex.
Needs a secure context (HTTPS)Yes
Needs a user gestureYes
How long it lastsPersistent per origin
How to take it backSite settings; Permissions API midi
Inside an iframeNeeds allow="midi" in iframes

Typical flow

  1. Call requestMIDIAccess({sysex})
  2. Permission prompt
  3. Enumerate inputs and outputs
  4. Send and receive MIDI messages

Data you get

What comes back: MIDIInput and MIDIOutput ports
Shape: list
How often: on call plus statechange events

FieldTypeUnitRangePrecision
port idstringopaqueper originhigh entropy
manufacturer, namestringtextdevice stringshigh entropy
versionstringtextdevice firmwaresome bits

Technical limits

  • Safari does not support
  • Sysex needs the stronger permission
  • Needs secure context

The story

What it is

A site asks to connect to your music gear, like a keyboard or drum pad.

For you

A pop up asks 'Allow this site to use your MIDI devices?'. If you say yes, a plugged in keyboard plays notes in the page.

For makers

Makers can build full music apps in a tab: synths, lessons and recording. A special system mode can even rewrite a device's settings, so the browser asks more carefully.

Where you see it

TypeExampleApps
musicYou play a plugged in keyboard and hear piano notes in the browser.BandLab, Soundtrap, Chrome Music Lab
educationA piano lesson site watches which keys you press and scores you.Flowkey
gamesA rhythm game lets you play with a MIDI drum pad.None named
creativeA visual artist links a controller's knobs to a live visual show.None named
liveA DJ tool in the browser reads a controller for mixing.None named
securityA site can tell which MIDI devices exist, which adds to a fingerprint.None named

Risks

  • Device fingerprint
  • Changes device settings

What the platform says

  • Mozilla: Web MIDI API. MDN says the API lets pages talk to MIDI devices like keyboards and drum machines.

Good uses and abuse

Legitimate uses

  • DAWs
  • Hardware editors

Known abuse

  • Device fingerprinting by connected gear

Scores

ScoreValueMeaning
Sensitivity3 of 5How revealing the data is
Utility3 of 5How useful it is to honest apps
Friction2 of 5How much the user has to do
Fingerprint bits5Rough identifying entropy, when known

History

  • 2015-05, Chrome 43: Web MIDI ships
  • 2022-12, Firefox 108: Web MIDI behind add-on install prompt
  • 2024-04, Chrome 124: Prompt for any MIDI access, not only sysex
  • Permissions API. Can check whether you allowed or blocked a feature, without asking you

Sources

How well checked: Based on official documentation.

On this page