Represents a Chord, consisting of a root, suffix (quality) and bass

Implements

  • ChordProperties

Methods

  • Determines whether the chord is a chord solfege

    Returns boolean

  • Determines whether the chord is a chord symbol

    Returns boolean

  • Determines whether the chord is a numeral

    Returns boolean

  • Determines whether the chord is numeric

    Returns boolean

  • Normalizes the chord root and bass notes:

    • Fab becomes Mi
    • Dob becomes Si
    • Si# becomes Do
    • Mi# becomes Fa
    • Fb becomes E
    • Cb becomes B
    • B# becomes C
    • E# becomes F
    • 4b becomes 3
    • 1b becomes 7
    • 7# becomes 1
    • 3# becomes 4

    Besides that it normalizes the suffix if normalizeSuffix is true. For example, sus2 becomes 2, sus4 becomes sus. All suffix normalizations can be found in src/normalize_mappings/suffix-mapping.txt.

    When the chord is minor, bass notes are normalized off of the relative major of the root note. For example, Em/A# becomes Em/Bb.

    Parameters

    • Optionalkey: null | string | Key = null

      the key to normalize to

    • Optionaloptions: { normalizeSuffix?: boolean } = {}

      options

      • OptionalnormalizeSuffix?: boolean

        whether to normalize the chord suffix after transposing

    Returns Chord

    the normalized chord

  • Converts the chord to a chord solfege, using the supplied key as a reference. For example, a numeric chord #4 with reference key Mi will return the chord symbol La#. When the chord is already a chord solfege, it will return a clone of the object.

    Parameters

    • OptionalreferenceKey: null | string | Key = null

      the reference key. The key is required when converting a numeric or numeral.

    Returns Chord

    the chord solfege

  • Converts the chord to a chord solfege string, using the supplied key as a reference. For example, a numeric chord #4 with reference key E will return the chord solfege A#. When the chord is already a chord solfege, it will return a string version of the chord.

    Parameters

    • OptionalreferenceKey: null | string | Key = null

      the reference key. The key is required when converting a numeric or numeral.

    Returns string

    the chord solfege string

  • Converts the chord to a chord symbol, using the supplied key as a reference. For example, a numeric chord #4 with reference key E will return the chord symbol A#. When the chord is already a chord symbol, it will return a clone of the object.

    Parameters

    • OptionalreferenceKey: null | string | Key = null

      the reference key. The key is required when converting a numeric or numeral.

    Returns Chord

    the chord symbol

  • Converts the chord to a chord symbol string, using the supplied key as a reference. For example, a numeric chord #4 with reference key E will return the chord symbol A#. When the chord is already a chord symbol, it will return a string version of the chord.

    Parameters

    • OptionalreferenceKey: null | string | Key = null

      the reference key. The key is required when converting a numeric or numeral.

    Returns string

    the chord symbol string

  • Converts the chord to a numeral chord, using the supplied key as a reference. For example, a chord symbol A# with reference key E will return the numeral chord #IV.

    Parameters

    • OptionalreferenceKey: null | string | Key = null

      the reference key. The key is required when converting a chord symbol

    Returns Chord

    the numeral chord

  • Converts the chord to a numeral chord string, using the supplied kye as a reference. For example, a chord symbol A# with reference key E will return the numeral chord #4.

    Parameters

    • OptionalreferenceKey: null | string | Key = null

      the reference key. The key is required when converting a chord symbol

    Returns string

    the numeral chord string

  • Converts the chord to a numeric chord, using the supplied key as a reference. For example, a chord symbol A# with reference key E will return the numeric chord #4.

    Parameters

    • OptionalreferenceKey: null | string | Key = null

      the reference key. The key is required when converting a chord symbol

    Returns Chord

    the numeric chord

  • Converts the chord to a numeric chord string, using the supplied kye as a reference. For example, a chord symbol A# with reference key E will return the numeric chord #4.

    Parameters

    • OptionalreferenceKey: null | string | Key = null

      the reference key. The key is required when converting a chord symbol

    Returns string

    the numeric chord string

  • Converts the chord to a string, eg Esus4/G# or 1sus4/#3

    Parameters

    • Optionalconfiguration: { useUnicodeModifier?: boolean } = {}

      options

      • OptionaluseUnicodeModifier?: boolean

        Whether or not to use unicode modifiers. This will make # (sharp) look like and b (flat) look like

    Returns string

    the chord string

  • Transposes the chord by the specified number of semitones

    Parameters

    • delta: number

      de number of semitones

    Returns Chord

    the new, transposed chord

  • Transposes the chord down by 1 semitone. Eg. A# becomes A, E becomes Eb

    Returns Chord

    the new, transposed chord

  • Transposes the chord up by 1 semitone. Eg. A becomes A#, Eb becomes E

    Returns Chord

    the new, transposed chord

  • Switches to the specified modifier

    Parameters

    • newModifier: Modifier

      the modifier to use: '#' or 'b'

    Returns Chord

    the new, changed chord

  • Tries to parse a chord string into a chord Any leading or trailing whitespace is removed first, so a chord like \n E/G# \r is valid.

    Parameters

    • chordString: string

      the chord string, eg Esus4/G# or 1sus4/#3.

    Returns null | Chord