Chord

public struct Chord: ChordDescription

Defines a chord with a root note and type.

  • Type of the chord.

    Declaration

    Swift

    public var type: ChordType
  • key

    Root key of the chord.

    Declaration

    Swift

    public var key: Key
  • Inversion index of the chord.

    Declaration

    Swift

    public private(set) var inversion: Int
  • Initilizes chord with root note and type.

    Declaration

    Swift

    public init(type: ChordType, key: Key, inversion: Int = 0)

    Parameters

    key

    Root key of the chord.

    type

    Tyoe of the chord.

  • Types of notes in chord.

    Declaration

    Swift

    public var keys: [Key]
  • Possible inversions of the chord.

    Declaration

    Swift

    public var inversions: [Chord]
  • Notation of the chord.

    Declaration

    Swift

    public var notation: String
  • Generates notes of the chord for octave.

    Declaration

    Swift

    public func pitches(octave: Int) -> [Pitch]

    Parameters

    octave

    Octave of the root note for the build chord from.

    Return Value

    Generates notes of the chord.

  • Generates notes of the chord for octave range.

    Declaration

    Swift

    public func pitches(octaves: [Int]) -> [Pitch]

    Parameters

    octaves

    Octaves of the root note to build chord from.

    Return Value

    Generates notes of the chord.

  • Returns the roman numeric string for a chord.

    Declaration

    Swift

    public func romanNumeric(for scale: Scale) -> String?

    Parameters

    scale

    The scale that the chord in.

    Return Value

    Roman numeric string for the chord in a scale.

  • Description of the chord.

    Declaration

    Swift

    public var description: String