@libraz/libcantus - v1.1.0
    Preparing search index...

    Function toInstrumentProfile

    • Resolve any instrument-shaped value to a plain InstrumentProfile.

      The counterpart of toNoteData for instruments: an entry point takes whatever form the caller has — the profile a project file holds, one of the built-in profiles, or an Instrument instance — and gets one shape back. An instance is accepted through its toJSON method rather than by its type, because the core layer cannot import the model layer that defines the class.

      Parameters

      • value: InstrumentProfileLike

        A plain profile, or a value whose toJSON returns one.

      • name: string = 'instrument'

        What the instrument is called in an error message, so a caller holding several of them hears which one was malformed.

      Returns ValidatedProfile

      The validated profile.

      If the value names no instrument, or the instrument it names is contradictory — a neck with no strings, a fret count that is no count, or a kit no limb reaches.