Class SongInstruments

Represents the Instruments of a Song with helper methods.

Properties

ID-instrument pair of the song's instruments.

Currently, this always includes the built-in instruments from Note Block Studio v5.

This should not be modified directly! Instead, utilize the various helper methods in this class.

firstCustomIndex: number = ...

The ID of the first custom instrument.

Methods

  • Delete an Instrument.

    Parameters

    • id: number

      ID of the instrument to be deleted

    Returns void

    Does not protect built-in instruments. This may not be desirable!

    According to the NBS specification, instrument IDs must be consecutive! Make sure to update any proceeding instrument IDs.

  • Set an existing Instrument at an ID.

    Parameters

    • id: number

      ID of the instrument to be set

    • instrument: Instrument

      The instrument to set at id.

    Returns Instrument

    Any existing instrument with the same ID as the added instrument will be overwritten. This includes built-in instruments, which may not be desirable!

    According to the NBS specification, instrument IDs must be consecutive!

Constructors