Skip to content

MIDIOutput

Defined in: src/MIDIOutput.ts:7

A MIDI output port — a sink for outbound MIDI messages. Mirrors the Web MIDI API MIDIOutput.

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


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: "output"

Defined in: src/MIDIOutput.ts:8

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/MIDIPort.ts:33

"statechange"

(this, e) => any

boolean | AddEventListenerOptions

void

MIDIPort.addEventListener

addEventListener(type, listener, options?): void

Defined in: src/MIDIPort.ts:38

string

EventListenerOrEventListenerObject

boolean | AddEventListenerOptions

void

MIDIPort.addEventListener


clear(): void

Defined in: src/MIDIOutput.ts:18

Clear any queued, not-yet-sent messages.

void


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


send(data, timestamp?): void

Defined in: src/MIDIOutput.ts:15

Queue a MIDI message for sending.

Uint8Array<ArrayBufferLike> | number[]

A complete MIDI message as bytes.

number

Optional performance.now()-domain time to send at.

void