-
Notifications
You must be signed in to change notification settings - Fork 22.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* first pass at event change * Update files/en-us/web/api/midiinput/midimessage_event/index.md Co-authored-by: Jean-Yves Perrier <jypenator@gmail.com> * Update files/en-us/web/api/midiinput/midimessage_event/index.md Co-authored-by: Jean-Yves Perrier <jypenator@gmail.com> * Update files/en-us/web/api/midiinput/midimessage_event/index.md Co-authored-by: Jean-Yves Perrier <jypenator@gmail.com> * Update files/en-us/web/api/midiinput/index.md Co-authored-by: Jean-Yves Perrier <jypenator@gmail.com> * Update files/en-us/web/api/midiinput/index.md Co-authored-by: Jean-Yves Perrier <jypenator@gmail.com> * Update files/en-us/web/api/midiinput/index.md Co-authored-by: Jean-Yves Perrier <jypenator@gmail.com> * Update files/en-us/web/api/midimessageevent/data/index.md Co-authored-by: Jean-Yves Perrier <jypenator@gmail.com> * Update files/en-us/web/api/midimessageevent/data/index.md Co-authored-by: Jean-Yves Perrier <jypenator@gmail.com> * updates * Update files/en-us/web/api/midiinput/index.md Co-authored-by: Jean-Yves Perrier <jypenator@gmail.com> Co-authored-by: Jean-Yves Perrier <jypenator@gmail.com>
- Loading branch information
Showing
7 changed files
with
69 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
title: 'MIDIInput: midimessage event' | ||
slug: Web/API/MIDIInput/midimessage_event | ||
tags: | ||
- midimessage | ||
- API | ||
- Event | ||
- Reference | ||
- MIDIInput | ||
browser-compat: api.MIDIInput.midimessage_event | ||
--- | ||
{{APIRef("Web MIDI API")}}{{securecontext_header}} | ||
|
||
The `midimessage` event of the [Web MIDI API](/en-US/Web/API/Web_MIDI_API) is fired when the MIDI port corresponding to this {{domxref("MIDIInput")}} finishes receiving one or more MIDI messages. An instance of {{domxref("MIDIMessageEvent")}} containing the message that was received is passed to the event handler. | ||
|
||
## Syntax | ||
|
||
Use the event name in methods like {{domxref("EventTarget.addEventListener", "addEventListener()")}}, or set an event handler property. | ||
|
||
```js | ||
addEventListener('midimessage', event => { }); | ||
|
||
onmidimessage = event => { }; | ||
``` | ||
|
||
## Event type | ||
|
||
An {{domxref("MIDIMessageEvent")}}. Inherits from {{domxref("Event")}}. | ||
|
||
{{InheritanceDiagram("MIDIMessageEvent")}} | ||
|
||
## Event properties | ||
|
||
_This interface also inherits properties from {{domxref("Event")}}._ | ||
|
||
- {{domxref("MIDIMessageEvent.data")}} | ||
- : A {{jsxref("Uint8Array")}} containing the data bytes of a single MIDI message. See the [MIDI specification](https://www.midi.org/specifications-old/item/table-1-summary-of-midi-message) for more information on its form. | ||
|
||
## Examples | ||
|
||
In the following example `midimessage` events are listened for on all input ports. When a message is received the {{domxref("MIDIMessageEvent.data")}} property is printed to the console. | ||
|
||
```js | ||
inputs.forEach(input => { | ||
input.onmidimessage = message => { | ||
console.log(message.data); | ||
} | ||
}) | ||
``` | ||
|
||
## Specifications | ||
|
||
{{Specifications}} | ||
|
||
## Browser compatibility | ||
|
||
{{Compat}} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters