Class MidiAccess

The MidiAccess class provides an interface for fetching MIDI ports which data can be sent to, or received from.

The recommended way to get a new instance of this class is through the asynchronous request() method.

Example:

const midiAccess = await MidiAccess.request();
console.log(midiAccess.getOutPortNames());

Hierarchy

  • MidiAccess

Constructors

  • Please use the MidiAccess.request() method instead.

    Parameters

    • baseAccess: MIDIAccess

    Returns MidiAccess

Accessors

  • get typeName(): string
  • Returns the name of this type. This can be used rather than instanceof which is sometimes unreliable.

    Returns string

Methods

  • This method searches through all MIDI in ports for a specific one by name, and returns the port object.

    Returns

    Parameters

    • portName: string

      The name of the expected MIDI in port.

    Returns null | MIDIInput

  • This method returns the names of all available MIDI in ports.

    Returns

    Returns string[]

  • This method searches through all MIDI out ports for a specific one by name, and returns the port object.

    Returns

    Parameters

    • portName: string

      The name of the expected MIDI out port.

    Returns null | MIDIOutput

  • This method returns the names of all available MIDI out ports.

    Returns

    Returns string[]

  • Calling this static method is the recommended way to get new instances of this class. It waits for the MIDI access request to be confirmed before returning a new MidiAccess instance.

    Returns Promise<MidiAccess>

Generated using TypeDoc