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

    Function formatChordSymbol

    • Format a Chord as a lead-sheet chord symbol.

      The inverse of parseChordSymbol: each quality maps to one canonical suffix spelling, and a slash bass is appended only when it differs from the root. When the chord carries rootSpelling/bassSpelling hints (as chords from parseChordSymbol do) and no explicit flats preference is given, the hints are reused so flat symbols round-trip unchanged.

      Parameters

      • chord: ChordData

        The chord to format.

      • Optionalopts: { flats?: boolean }

        Formatting options.

        • Optionalflats?: boolean

          Prefer flat spellings over sharps for altered roots/basses; passing either true or false overrides any spelling hints.

      Returns string

      The chord symbol text.

      import { makeChord, formatChordSymbol } from '@libraz/libcantus';
      formatChordSymbol(makeChord(0, 'min7')); // 'Cm7'