Universal Music Theory Library - v0.12.0
    Preparing search index...

    Function parseChordSymbol

    • Parses a standard chord symbol into a Chord object.

      Supported formats:

      • Triads: C, Cm, Cdim, Caug, Csus2, Csus4
      • Seventh chords: Cmaj7, Cm7, C7, Cdim7, Cm7b5, CmM7
      • Extended: C9, C11, C13, Cmaj9, etc.
      • Altered: C7b9, C7#11, C7alt, Calt
      • Slash chords: C/E, Cmaj7/G, C6/9/E (only a note name after the last slash is a bass)
      • Shorthands: CΔ, CΔ7, Cø, C-7, C°, C°7, C+
      • Compositional (any combination): Cm9b5, C13b9#11, CmM9, Cmaj13#11 Alterations (b5 #5 b9 #9 #11 b13) may appear in any order. Spaces within the suffix are ignored (C7 b9 #11 = C7b9#11).

      Resolution order: dictionary lookup → compositional parser → error. Named chords (dim7, add9, 6/9, alt, etc.) are always resolved via the dictionary regardless of whether they could be parsed compositionally.

      Root is case-insensitive (cmaj7 = Cmaj7).

      Parameters

      • symbol: string

        Chord symbol string.

      • tuning: TuningSystem = TET12

        Target tuning system (default: 12-TET). Each note goes to the step that stands for it (getStandardStep).

      • octave: number = 4

        Octave for the root note (default: 4).

      Returns Chord

      if the symbol cannot be parsed or the chord type is neither in the dictionary nor compositionally valid; RangeError if the tuning has no step for one of its notes (C in a 7-note JI scale on A).