Quality

public enum Quality: String, CaseIterable, Codable, Comparable, Sendable

All the chord qualities we know about

Note

Changes to the raw value might break the databases

Triad

  • Major

    Declaration

    Swift

    case major = ""
  • Minor

    Declaration

    Swift

    case minor = "m"
  • aug

    Augmented

    Declaration

    Swift

    case aug = "aug"
  • dim

    Diminished

    Declaration

    Swift

    case dim = "dim"

Seventh

  • 7

    Declaration

    Swift

    case seven = "7"
  • 7#5

    Declaration

    Swift

    case sevenSharpFive = "7#5"
  • 7b5

    Declaration

    Swift

    case sevenFlatFive = "7b5"
  • 7#9

    Declaration

    Swift

    case sevenSharpNine = "7#9"
  • 7b9

    Declaration

    Swift

    case sevenFlatNine = "7b9"
  • Minor 7

    Declaration

    Swift

    case minorSeven = "m7"
  • Major 7

    Declaration

    Swift

    case majorSeven = "maj7"
  • Augmented 7

    Declaration

    Swift

    case augSeven = "aug7"
  • Diminished 7

    Declaration

    Swift

    case dimSeven = "dim7"
  • Major 7#5

    Declaration

    Swift

    case majorSevenSharpFive = "maj7#5"
  • Major 7b5

    Declaration

    Swift

    case majorSevenFlatFive = "maj7b5"
  • Minor Major 7

    Declaration

    Swift

    case minorMajorSeven = "mMaj7"
  • Minor Major 7b5

    Declaration

    Swift

    case minorMajorSeventFlatFive = "mMaj7b5"
  • Minor 7b5

    Declaration

    Swift

    case minorSevenFlatFive = "m7b5"

Suspended

  • Sus 2

    Declaration

    Swift

    case susTwo = "sus2"
  • Sus 4

    Declaration

    Swift

    case susFour = "sus4"
  • 7 sus 2

    Declaration

    Swift

    case sevenSusTwo = "7sus2"
  • 7 sus 4

    Declaration

    Swift

    case sevenSusFour = "7sus4"

Extended

  • 9

    Declaration

    Swift

    case nine = "9"
  • Major 9

    Declaration

    Swift

    case majorNine = "maj9"
  • Minor Major 9

    Declaration

    Swift

    case minorMajorNine = "mMaj9"
  • Minor 9

    Declaration

    Swift

    case minorNine = "m9"
  • 9b5

    Declaration

    Swift

    case nineFlatFive = "9b5"
  • 9#11

    Declaration

    Swift

    case nineSharpEleven = "9#11"
  • 11

    Declaration

    Swift

    case eleven = "11"
  • Major 11

    Declaration

    Swift

    case majorEleven = "maj11"
  • Minor 11

    Declaration

    Swift

    case minorEleven = "m11"
  • Minor Major 11

    Declaration

    Swift

    case minorMajorEleven = "mMaj11"
  • 13

    Declaration

    Swift

    case thirteen = "13"
  • Major 13

    Declaration

    Swift

    case majorThirteen = "maj13"
  • Minor 13

    Declaration

    Swift

    case minorThirteen = "m13"

Added

  • 5

    Declaration

    Swift

    case five = "5"
  • six

    6

    Declaration

    Swift

    case six = "6"
  • Minor 6

    Declaration

    Swift

    case minorSix = "m6"
  • 6/9

    Declaration

    Swift

    case sixNine = "69"
  • Minor 6/9

    Declaration

    Swift

    case minorSixNine = "m69"
  • Add 4

    Declaration

    Swift

    case addFour = "add4"
  • Add 9

    Declaration

    Swift

    case addNine = "add9"
  • Minor add 9

    Declaration

    Swift

    case minorAddNine = "madd9"
  • Add 11

    Declaration

    Swift

    case addEleven = "add11"

Augmented

  • Augmented 9

    Declaration

    Swift

    case augNine = "aug9"

Other

  • Fallback

    Declaration

    Swift

    case unknown
  • Implement Comparable

    Declaration

    Swift

    public static func < (lhs: Self, rhs: Self) -> Bool
  • A suitible string for displaying to users.

    • accessible: “seven flat five”. Useful for text to speech.
    • short: Maj, min
    • symbol: dim⁷, + For the most common uses of symbols in music notation.
    • altSymbol: °, ⁺ Alternative examples of the above symbol examples.

    Advice is to look through this list and choose what is appropriate for your app. Please submit a PR if you’d like to add or change some of these items if you beleive it could be improved. Because of this, do not rely on these values to always remain the same. So don’t use them as identifiers, or keys.

    For accessibility strings the “th” is dropped from numbers. While not completely accurate, it rolls better.

    Symbols use superscript where appropriate (and possible). Be aware that not all fonts will support this. Use short instead if you’re unsure.

    Some items may also be identical across types. Only in rare cases will an alt symbol be provided e.g. (dim⁷,°)

    Declaration

    Swift

    public var display: (accessible: String, short: String, symbolized: String, altSymbol: String)
  • Supports a few most popular groupings. Major, Minor, Diminished, Augmented, Suspended. Please open a PR if you’d like to introduce more types or offer corrections. Anything that doesn’t fit into the above categories are put in other.

    The intention for the group is for developers to offer different filter types for chart lookup.

    Declaration

    Swift

    var group: Chord.Group
  • Convert an Quality enum to a Quality string

    Declaration

    Swift

    var stringValue: String
  • The intervals of a Chord/Quality

    Declaration

    Swift

    var intervals: (intervals: [Interval], optional: [Interval])
  • An array with all optional names for a Chord/Quality

    Note

    Used to lookup a quality from a ChordPro definition

    Declaration

    Swift

    var name: [String]