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

    Function negativeHarmonyMirror

    • Reflect a chord across the tonic–dominant axis of a key (negative harmony).

      Every pitch class p maps to (2*T + 7 - p) mod 12, where T is the key tonic — the reflection that swaps the tonic with the dominant. The mirrored pitch classes (including the bass, if set) are reassembled into a chord by detectChordBest; when no chord is recognized, the mirrored root and the original quality are used as a fallback.

      The result is spelled the way key writes it, as rootSpelling and bassSpelling hints, so the reflection of a chord in a flat-side key keeps flat names: in Eb major the mirror of Bb formats as Abm, not G#m.

      Parameters

      • chord: ChordLike

        The chord to reflect, as a chord symbol or as chord data.

      • key: SpelledKeyLike

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

      Returns ChordData

      The negative-harmony counterpart of the chord.

      import { negativeHarmonyMirror, makeChord, majorKey } from '@libraz/libcantus';
      negativeHarmonyMirror(makeChord(7, 'maj'), majorKey(0));
      // G major reflected across C's axis => F minor (rootPc 5, quality 'min')