@libraz/libcantus - v0.9.3
    Preparing search index...

    Function substituteChord

    • Propose substitutions for a chord within a key.

      Candidates are generated by several relationships and deduplicated against the original chord and each other:

      • tritone: for a dominant-type chord, the dominant seventh a tritone away.
      • secondary-dominant: for a stable target, the dominant seventh a fifth above its root (tonicizing it).
      • relative: a diatonic triad a third away that shares two common tones.
      • borrowed: a triad from the parallel mode with the same harmonic function.
      • chromatic-mediant: a major/minor triad a third away sharing one common tone.

      Each result carries its Roman numeral and harmonic function in key. When opts.melodyPcs is given, only substitutions whose pitch classes contain all of those pitch classes are returned.

      Parameters

      Returns Substitution[]

      The deduplicated substitution candidates.

      import { substituteChord, makeChord, majorKey } from '@libraz/libcantus';
      const subs = substituteChord(makeChord(7, 'dom7'), majorKey(0));
      // includes the tritone sub Db7 (rootPc 1, quality 'dom7')