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

    Function transposeChordSymbol

    • Transpose a chord symbol by a number of semitones.

      The symbol is read in the same system it is written back in, so a German chart stays German across the transposition.

      The root and the bass are respelled where moving them by letter would leave a name no chart writes, so raising a flat chart a semitone gives Bmaj7 rather than Cbmaj7. Pass flats to write the whole symbol on one side of the staff, root and bass together.

      Parameters

      • text: string

        The chord symbol text.

      • semitones: number

        Signed semitone offset to apply to the root and bass.

      • Optionalopts: ChordSymbolOptions

        Options for reading and writing the symbol; see ChordSymbolOptions.

      Returns string

      The transposed chord symbol text.

      If text does not parse as a chord symbol.

      import { transposeChordSymbol } from '@libraz/libcantus';
      transposeChordSymbol('C/G', 2); // 'D/A'
      transposeChordSymbol('H7', 1, { system: 'german' }); // 'C7'