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

    Function pivotChords

    • List the chords a modulation from from to to can pivot on.

      A pivot chord belongs to both keys at once, so it can be heard as a degree of the key being left and reinterpreted as a degree of the key being entered — the seamless way into the new key. Candidates are the diatonic triads of from, degrees 1 through 7, kept when every one of their pitch classes is also a scale tone of to; the result is ordered by their degree in from.

      Only triads are candidates. The textbook pivot is a triad: a seventh narrows the shared ground by a whole tone for no analytical gain, and the chord that turns the modulation is heard as a triad whether or not a seventh is played over it.

      A key that is not heptatonic has no diatonic triads at all — stacking scale thirds only lands on a triad over seven degrees — so such a from key yields an empty list rather than an error. A to key is only tested for membership, so it may be any scale; its numerals then follow the chordToRoman fallback of naming roots against the parallel major.

      Parameters

      • from: KeyLike

        The key being left, as a key name, a key/scale, or a Key.

      • to: KeyLike

        The key being entered, in any of the same forms.

      Returns PivotChord[]

      The shared triads, ascending by their degree in from.

      import { majorKey, pivotChords } from '@libraz/libcantus';
      pivotChords(majorKey(0), majorKey(7)).map((p) => `${p.romanFrom}=${p.romanTo}`);
      // ['I=IV', 'iii=vi', 'V=I', 'vi=ii'] — C major into G major