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

    Function isDiatonic

    • Whether every pitch class of a chord belongs to the key's scale.

      The test is strict against the key's own mode mask: in a natural-minor key the harmonic-minor dominant (major V) is not diatonic, since the raised leading tone lies outside the mask. Borrowing predicates treat that case as an in-key alteration separately (see isBorrowedChord).

      Parameters

      • chord: ChordLike

        The chord to test, as a chord symbol, chord data, or a Chord.

      • key: KeyLike

        The prevailing key, as a key name, a key/scale, or a Key.

      Returns boolean

      True if all chord pitch classes are scale tones.