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

    Function chordScales

    • List the scales that fit over a chord, best fit first.

      Only the chord root is considered as the scale root, matching the conventional chord-scale relationship. Every entry of NAMED_SCALES whose pitch-class set is a superset of the chord's is returned once per distinct pitch-class set (aliased masks such as major/ionian report only the modal name). The chromatic scale is only returned as a fallback when no other scale contains the chord.

      The ranking applies these keys in order:

      1. The idiomatic scales for the chord quality, in the order they are named there, ahead of every scale that is not one of them.
      2. For bare triads and smaller chords, heptatonic scales ahead of pentatonics and other sizes: a pentatonic adds no modal color over a triad, so the seven-note modes are the more useful answer.
      3. Fewest extra scale tones beyond the chord.
      4. Conventional modal preference.
      5. Fewest avoid notes, which separates the symmetric and melodic-minor scales the modal preference does not name.
      6. Alphabetical order, so the list is stable.

      The idiomatic key comes first, so the head of the list is the scale a player would name rather than the tightest fit: over Cm7b5 the locrian mode leads even though the blues scale adds fewer tones, because locrian is what a half-diminished chord is read as. Read further down the list, or pick by name, when the closest fit is what is wanted; scalesForChanges makes the choice for a whole progression.

      Parameters

      • chord: ChordLike

        The chord to fit scales over, as a chord symbol, chord data, or a Chord.

      Returns ChordScaleMatch[]

      The matching scales rooted on the chord root, best fit first.

      import { makeChord, chordScales } from '@libraz/libcantus';
      const scales = chordScales(makeChord(0, 'maj7'));
      // scales for Cmaj7, best fit first; each is { name, rootPc: 0 }