spessasynth_core documentation
    Preparing search index...

    Interface SequencerEvent

    SequencerEvent represents an event that SpessaSynthSequencer emits.

    Events can be received by specifying a SpessaSynthSequencer.onEventCall callback.

    interface SequencerEvent {
        loopCountChange: { newCount: number };
        metaEvent: { event: MIDIMessage; trackIndex: number };
        midiMessage: { channelOffset: number; message: number[]; time: number };
        songChange: { songIndex: number };
        songEnded: object;
        songListChange: { newSongList: BasicMIDI[] };
        timeChange: { newTime: number };
    }
    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.

    midiMessage: { channelOffset: number; message: number[]; time: number }

    This event is called when a MIDI message is sent and externalMIDIPlayback is true.

    Type Declaration

    • channelOffset: number

      The channel offset of this message, it is useful for multi-port MIDI files. For example, offset of 0 means the first 16 channels (0-15). Offset of 16 means the second port (channels 16-31). The second port could be routed to a second MIDI output or a second MIDI device.

    • message: number[]

      The binary MIDI message data.

    • time: number

      The value of SpessaSynthProcessor.currentTime when this event was sent. Use this for scheduling MIDI messages to your external MIDI device.

    songChange: { songIndex: number }

    This event is called when the song changes.

    Type Declaration

    songEnded: object

    This event is called when the playback stops.

    songListChange: { newSongList: BasicMIDI[] }

    This event is called when the song list changes.

    Type Declaration

    • newSongList: BasicMIDI[]

      The new song list.

    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.