W3cubDocs

/Web APIs

MIDIMessageEvent: MIDIMessageEvent() constructor

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The MIDIMessageEvent() constructor creates a new MIDIMessageEvent object. Typically this constructor is not used as events are created when a MIDIInput finishes receiving one or more MIDI messages.

Syntax

js

new MIDIMessageEvent(type)
new MIDIMessageEvent(type, options)

Parameters

type

A string with the name of the event. It is case-sensitive and browsers always set it to MIDIMessageEvent.

options Optional

An object that, in addition of the properties defined in Event(), can have the following properties:

data

A Uint8Array instance containing the data bytes of the MIDI message.

Return value

A new MIDIMessageEvent object.

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
MIDIMessageEvent 43 79 108 No 30 No No 43 No 30 No 4.0

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/MIDIMessageEvent/MIDIMessageEvent