メインコンテンツまでスキップ

Function: createMIDIMessage()

function createMIDIMessage(midiAccess, onMIDIMessage): MIDIMessageInstance;

Defined in: dom/src/midi/message.ts:17

Listen to raw midimessage events on every input of a MIDIAccess.

The set of inputs is followed rather than sampled: MIDIAccess fires statechange when a device is plugged in or unplugged, and the listeners move with it. A keyboard connected after access was granted works without the caller having to rebuild anything.

Use this when you need more detail than createMIDIInput provides.

Parameters​

ParameterType
midiAccessMIDIAccess | null
onMIDIMessage(event) => void

Returns​

MIDIMessageInstance