Skip to content

MIDIInput

Defined in: src/MIDIInput.ts:9

A MIDI input port — a source of inbound MIDI messages. Mirrors the Web MIDI API MIDIInput.

readonly connection: "open" | "closed" | "pending"

Defined in: src/MIDIPort.ts:23

The port’s connection state.

MIDIInput.connection


readonly id: string

Defined in: src/MIDIPort.ts:10

A unique, stable id for this port.

MIDIPort.id


readonly manufacturer: string

Defined in: src/MIDIPort.ts:12

The manufacturer of the port, if known.

MIDIPort.manufacturer


readonly name: string

Defined in: src/MIDIPort.ts:14

The display name of the port.

MIDIPort.name


onmidimessage: ((e) => void) | null

Defined in: src/MIDIInput.ts:13

Handler invoked for every complete inbound MIDI message.


onstatechange: ((e) => void) | null

Defined in: src/MIDIPort.ts:31

Handler invoked when the port’s state changes.

MIDIPort.onstatechange


readonly state: "connected" | "disconnected"

Defined in: src/MIDIPort.ts:21

Whether the underlying device is "connected" or "disconnected".

MIDIInput.state


readonly type: "input"

Defined in: src/MIDIInput.ts:10

Whether this is an "input" or "output" port.

MIDIPort.type


readonly version: string

Defined in: src/MIDIPort.ts:18

The version of the port, if known.

MIDIPort.version

addEventListener(type, listener, options?): void

Defined in: src/MIDIInput.ts:15

"midimessage"

(this, e) => any

boolean | AddEventListenerOptions

void

MIDIPort.addEventListener

addEventListener(type, listener, options?): void

Defined in: src/MIDIInput.ts:21

"statechange"

(this, e) => any

boolean | AddEventListenerOptions

void

MIDIPort.addEventListener

addEventListener(type, listener, options?): void

Defined in: src/MIDIInput.ts:26

string

EventListenerOrEventListenerObject

boolean | AddEventListenerOptions

void

MIDIPort.addEventListener


close(): Promise<void>

Defined in: src/MIDIPort.ts:28

Close the port.

Promise<void>

MIDIPort.close


dispatchEvent(event): boolean

Defined in: src/MIDIEventTarget.ts:23

Event

boolean

MIDIPort.dispatchEvent


open(): Promise<void>

Defined in: src/MIDIPort.ts:26

Open the port, resolving when it is ready for I/O.

Promise<void>

MIDIPort.open


removeEventListener(type, listener, options?): void

Defined in: src/MIDIEventTarget.ts:18

string

EventListenerOrEventListenerObject

boolean | EventListenerOptions

void

MIDIPort.removeEventListener