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

    Function chordFromSpec

    • Build a chord from a ChordSpec.

      The structural way in, for the chords a quality name cannot reach: the tones come from the spec, and quality is the name that fits it, or the nearest name when none does. A chord built this way is an ordinary Chord — every consumer reads its intervals as before, and formatChordSymbol writes the alterations back out.

      Parameters

      • spec: ChordSpec

        The chord spec; its rootPc/bassPc become the chord's.

      Returns ChordData

      The constructed chord.

      If any part of the spec is not one the model defines.

      import { chordFromSpec } from '@libraz/libcantus';
      chordFromSpec({
      rootPc: 0,
      base: 'maj',
      seventh: 'maj7',
      alterations: [{ degree: 11, alter: 1 }],
      additions: [],
      omissions: [],
      });
      // { rootPc: 0, quality: 'maj7#11', intervals: [0, 4, 7, 11, 18] }