xen-midi
    Preparing search index...

    Class MidiOut

    Wrapper for a webmidi.js output. Uses multiple channels to achieve polyphonic microtuning.

    Index

    Constructors

    Properties

    Methods

    Constructors

    • Construct a new wrapper for a webmidi.js output.

      Parameters

      • output: Output | null

        Output device or null if you need a dummy out.

      • channels: Set<number>

        Channels to use for sending pitch bent MIDI notes. Number of channels determines maximum microtonal polyphony.

      • Optionallog: (msg: string) => void

        Logging function.

      Returns MidiOut

    Properties

    channels: Set<number>
    log: (msg: string) => void
    output: Output | null

    Methods

    • Schedule a series of notes to be played at a later time. Notes are converted to note-on/off events, sorted by timestamp, and then emitted in causal order. Please note that this reserves the channels until all notes have finished playing.

      Parameters

      • notes: Note[]

        Notes to be played.

      Returns void

    • Send a note-on event and pitch-bend to the output device on one of the available channels.

      Parameters

      • frequency: number

        Frequency of the note in Hertz (Hz).

      • OptionalrawAttack: number

        Attack velocity of the note from 0 to 127.

      • Optionaltime: number

      Returns (rawRelease?: number, time?: number) => void

      A callback for sending a corresponding note off on the correct channel.