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

    Function chordToRoman

    • Render a chord as a Roman numeral relative to a key.

      Diatonic roots take their scale-degree numeral directly, so numerals are correct in both major and minor keys (and any custom scale). The quality selects the case and suffix; chromatic roots receive a flat/sharp spelling by convention. When the chord carries a bassPc on a chord tone, a figured-bass inversion (6, 64, 65, 43, 42) is emitted for plain triads and true seventh chords; added-tone and extended qualities have no lossless figure and render in root position instead (the bass is dropped, pitch classes are preserved).

      Parameters

      Returns string

      The Roman numeral string.

      import { chordToRoman, makeChord, majorKey } from '@libraz/libcantus';
      chordToRoman(makeChord(7, 'dom7'), majorKey(0)); // => 'V7' (G7 in C major)