spessasynth_lib documentation
    Preparing search index...

    Interface LibSequencerEvent

    All event types which get emitted by Sequencer.

    interface LibSequencerEvent {
        loopCountChange: { newCount: number };
        metaEvent: { event: MIDIMessage; trackIndex: number };
        midiError: Error;
        songChange: { midiData: MIDIData; songIndex: number };
        songEnded: object;
        textEvent: { event: MIDIMessage; lyricsIndex: number };
        timeChange: { newTime: number };
    }

    Hierarchy

    • Omit<CoreSequencerEvent, "midiMessage" | "songListChange">
      • LibSequencerEvent
    Index
    loopCountChange: { newCount: number }

    This event is called when the loop count changes (decreases).

    Type Declaration

    • newCount: number

      The new loop count.

    metaEvent: { event: MIDIMessage; trackIndex: number }

    This event is called when a MIDI Meta event is encountered.

    It may be useful for listening for events such as tempo change or lyric event.

    Type Declaration

    • event: MIDIMessage

      The MIDI message of the meta event.

    • trackIndex: number

      The index of the track where the meta event was encountered.

    midiError: Error

    This event is triggered when a MIDI parsing error is encountered.

    songChange: { midiData: MIDIData; songIndex: number }

    This event is triggered when the current song changes.

    Type Declaration

    • midiData: MIDIData

      The data of the new song.

    • songIndex: number

      The index of the new song in the playlist. If shuffle mode is enabled, this is the index of the shuffled song list.

    songEnded: object

    This event is called when the playback stops.

    textEvent: { event: MIDIMessage; lyricsIndex: number }

    This event is triggered when a Text Event is encountered.

    Type Declaration

    • event: MIDIMessage

      The raw event.

    • lyricsIndex: number

      If the text is a lyric, the index of the lyric in BasicMIDI.lyrics, otherwise -1.

    timeChange: { newTime: number }

    This event is called when SpessaSynthSequencer.currentTime is changed.

    This event also gets called when a song gets changed.

    Type Declaration

    • newTime: number

      The new time in seconds.