Skip to Content
Platform.Ontology

Web MIDI

Lets a site send and receive MIDI messages to music gear.

Asks you firstHardware and accessoriesMIDIWeb browsersWhile you use it

In one line

Can send and get notes with music gear, after you allow it

Lets a site send and receive MIDI messages to music gear.

Exposes the names of connected MIDI ports and live note and control data from keyboards and pads. With sysex it can reconfigure or flash devices.

What it can and can't do

What the user does: You tap Connect keyboard and allow MIDI access in the pop up.

It can

  • Listen for notes from your keyboard or controller
  • Send notes and lights to your music gear
  • Show a stronger warning before deeper control called sysex

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 if you remove the permission

How it differs between platforms: Chrome, Edge and Firefox support it. Safari and iPhone do not.

Browser support

BrowserStatusFirst versionReleasedNote
ChromeSupported432015-05-19None
EdgeSupported792020-01-15None
FirefoxSupported1082022-12-13None
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}), inputs, outputs, onmidimessage, output.send()
Permission namemidi
Permissions policymidi
Browser compat keysapi.MIDIAccess
api.MIDIInput
api.MIDIOutput
api.Navigator.requestMIDIAccess
How access is grantedprompt
What the user seesPermission bubble: use MIDI devices (sysex prompt is stronger)
Needs a secure context (HTTPS)Yes
Needs a user gestureNo
How long it lastsPer origin; sysex separate from basic
How to take it backSite settings
Inside an iframeNeeds allow="midi"

Typical flow

  1. requestMIDIAccess()
  2. Prompt
  3. Iterate inputs and outputs
  4. Listen for midimessage

Data you get

What comes back: MIDI messages with timestamps
Shape: event
How often: per message

FieldTypeUnitRangePrecision
port.name / manufacturer / idstringNonedevice definedstable id per origin
databinarybytesstatus 0x80 to 0xFF, data bytes 0 to 127; sysex up to device limitNot listed
timeStampfloatmsDOMHighResTimeStampmicrosecond class

Technical limits

  • Cannot play audio itself
  • Safari and iOS do not implement it
  • Needs HTTPS in Chrome

The story

What it is

A site can send and receive music signals with your gear.

For you

A pop up asks to use your music devices. After you allow it, your keyboard and a page play together.

For makers

Makers build online synths, lessons and studios that act like desktop music software. It cuts install friction for music apps.

Where you see it

TypeExampleApps
musicA browser studio records what you play on a MIDI keyboard.BandLab, Soundtrap
educationA piano learning site shows which keys you hit.Flowkey
gamesA rhythm game uses your drum pad.None named
liveA live visual artist links controller knobs to a stage show.None named
creativeA sound design site lets you tweak a hardware synth from a web page.None named
securityA site can list your MIDI gear, which adds to a device fingerprint.None named

Risks

  • Device fingerprint
  • Changing device settings

What the platform says

  • Mozilla: Web MIDI API. MDN says Web MIDI lets web pages connect to and use musical instruments and controllers.

Good uses and abuse

Legitimate uses

  • Browser DAWs and synths
  • MIDI learn controls
  • Device editors

Known abuse

  • Port list as a fingerprint
  • Sysex writes to firmware

Scores

ScoreValueMeaning
Sensitivity2 of 5How revealing the data is
Utility4 of 5How useful it is to honest apps
Friction2 of 5How much the user has to do
Fingerprint bitsNot ratedRough identifying entropy, when known

History

  • 2015-04, Chrome 43: Web MIDI ships
  • 2020, Chrome 77: Permission required for all use, not only sysex
  • 2022-10, Firefox 108: Firefox ships Web MIDI behind a site permission add-on prompt

Sources

How well checked: Checked against real behavior.

On this page