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

    Function realizeFiguredBass

    • Realize a figured bass: the chord a bass note and its figures name in a key.

      The chord carries the given bass as its bassPc, so an inversion reads as one everywhere the library measures a bass against a root, and carries the letter spellings of its root and bass so the realization can be respelled without losing the accidentals the figures asked for.

      See figuredBassRealization for the figure grammar this accepts and for the spelled notes and suspensions it drops. A moving figure such as 4-3 returns the chord it resolves into.

      Parameters

      • bass: NoteLike

        The bass note, spelled; its octave, if any, is not used.

      • figures: string

        The figures written under the bass; empty for an unfigured note.

      • key: KeyLike

        The prevailing key, which supplies every unaltered interval.

      Returns ChordData

      The chord the figures name.

      If the figures are malformed or name no chord (InvalidInputError), if the key is not heptatonic (InvalidInputError), or if the figures sound a chord no ChordQuality names (NoSolutionError).

      import { majorKey, minorKey, parseNote, realizeFiguredBass } from '@libraz/libcantus';
      realizeFiguredBass(parseNote('B'), '6', majorKey(0));
      // G major with B in the bass: { rootPc: 7, quality: 'maj', bassPc: 11, ... }
      realizeFiguredBass(parseNote('G'), 'n', minorKey(0));
      // G major in C minor: the leading tone is the B natural the score prints