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.
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')
Reflect a chord across the tonic–dominant axis of a key (negative harmony).
Every pitch class
pmaps to(2*T + 7 - p) mod 12, whereTis 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.