Skip to main content

MidiOutput

caution

This service is experimental and may change in the future.

A MIDI output device.

import { MidiOutput } from "@devicescript/core"

const midiOutput = new MidiOutput()

Commands

clear

Clears any pending send data that has not yet been sent from the MIDIOutput's queue.

midiOutput.clear(): Promise<void>

send

Enqueues the message to be sent to the corresponding MIDI port

midiOutput.send(data: Buffer): Promise<void>

Registers

enabled

Opens or closes the port to the MIDI device

  • type: Register<boolean> (packing format u8)

  • read and write

import { MidiOutput } from "@devicescript/core"

const midiOutput = new MidiOutput()
// ...
const value = await midiOutput.enabled.read()
await midiOutput.enabled.write(value)
  • track incoming values
import { MidiOutput } from "@devicescript/core"

const midiOutput = new MidiOutput()
// ...
midiOutput.enabled.subscribe(async (value) => {
...
})
note

write and read will block until a server is bound to the client.