DiatonicInterval

public struct DiatonicInterval : DiatonicIntervalProtocol

Descriptor for ordered interval between two Pitch values.

  • The direction of a OrderedIntervalDescriptor.

    Declaration

    Swift

    public let direction: Direction
  • The DiatonicIntervalNumber value of a OrderedIntervalDescriptor.

    (e.g., .unison, .second, .third, .fourth, .fifth, .sixth, .seventh).

    Declaration

    Swift

    public let number: Number
  • The DiatonicIntervalQuality value of a OrderedIntervalDescriptor.

    (e.g., .diminished, .minor, .perfect, .major, .augmented).

    Declaration

    Swift

    public let quality: Quality
  • Declaration

    Swift

    public var semitones: Double { get }

    Return Value

    The amount of semitones in this OrderedIntervalDescriptor.

  • Declaration

    Swift

    public var steps: Int { get }

    Return Value

    The amount of letter name steps in this OrderedIntervalDescriptor.

  • d1

    Diminished unison.

    Declaration

    Swift

    public static let d1: DiatonicInterval
  • Unison.

    Declaration

    Swift

    public static let unison: DiatonicInterval
  • d2

    Diminished second.

    Declaration

    Swift

    public static let d2: DiatonicInterval
  • A1

    Augmented Unison.

    Declaration

    Swift

    public static let A1: DiatonicInterval
  • m2

    Minor second.

    Declaration

    Swift

    public static let m2: DiatonicInterval
  • M2

    Major second.

    Declaration

    Swift

    public static let M2: DiatonicInterval
  • d3

    Diminished third.

    Declaration

    Swift

    public static let d3: DiatonicInterval
  • A2

    Augmented second.

    Declaration

    Swift

    public static let A2: DiatonicInterval
  • m3

    Minor third.

    Declaration

    Swift

    public static let m3: DiatonicInterval
  • M3

    Major third.

    Declaration

    Swift

    public static let M3: DiatonicInterval
  • d4

    Diminished fourth.

    Declaration

    Swift

    public static let d4: DiatonicInterval
  • A3

    Augmented third.

    Declaration

    Swift

    public static let A3: DiatonicInterval
  • P4

    Perfect fourth.

    Declaration

    Swift

    public static let P4: DiatonicInterval
  • A4

    Augmented fourth.

    Declaration

    Swift

    public static let A4: DiatonicInterval
  • d5

    Diminished fifth

    Declaration

    Swift

    public static let d5: DiatonicInterval
  • P5

    Perfect fifth.

    Declaration

    Swift

    public static let P5: DiatonicInterval
  • d6

    Diminished sixth.

    Declaration

    Swift

    public static let d6: DiatonicInterval
  • A5

    Augmented fifth.

    Declaration

    Swift

    public static let A5: DiatonicInterval
  • m6

    Minor sixth.

    Declaration

    Swift

    public static let m6: DiatonicInterval
  • M6

    Major sixth.

    Declaration

    Swift

    public static let M6: DiatonicInterval
  • d7

    Diminished seventh.

    Declaration

    Swift

    public static let d7: DiatonicInterval
  • A6

    Augmented sixth.

    Declaration

    Swift

    public static let A6: DiatonicInterval
  • m7

    Minor seventh.

    Declaration

    Swift

    public static let m7: DiatonicInterval
  • M7

    Major seventh.

    Declaration

    Swift

    public static let M7: DiatonicInterval
  • A7

    Augmented seventh.

    Declaration

    Swift

    public static let A7: DiatonicInterval
  • The .unison is the Additive zero.

    Declaration

    Swift

    public static var zero: DiatonicInterval
  • Declaration

    Swift

    public static func + (lhs: DiatonicInterval, rhs: DiatonicInterval)
        -> DiatonicInterval

    Return Value

    The sum of two DiatonicInterval values.

  • Creates an DiatonicInterval with a given quality and number.

    Declaration

    Swift

    public init(_ quality: Quality, _ ordinal: Number)
  • Creates a perfect DiatonicInterval.

    let perfectFifth = DiatonicInterval(.perfect, .fifth)
    

    Declaration

    Swift

    public init(_ quality: Quality.Perfect, _ ordinal: Number.Perfect)
  • Creates a perfect DiatonicInterval with a given direction.

    let descendingPerfectFifth = DiatonicInterval(.descending, .perfect, .fifth)
    

    Declaration

    Swift

    public init(_ direction: Direction, _ quality: Quality.Perfect, _ ordinal: Number.Perfect)
  • Creates an imperfect DiatonicInterval.

    let majorSecond = DiatonicInterval(.major, .second)
    let minorThird = DiatonicInterval(.minor, .third)
    let majorSixth = DiatonicInterval(.major, .sixth)
    let minorSeventh = DiatonicInterval(.minor, .seventh)
    

    Declaration

    Swift

    public init(_ quality: Quality.Imperfect, _ ordinal: Number.Imperfect)
  • Creates an imperfect DiatonicInterval.

    let majorSecond = DiatonicInterval(.ascending, .major, .second)
    let minorThird = DiatonicInterval(.descending, .minor, .third)
    let majorSixth = DiatonicInterval(.ascending, .major, .sixth)
    let minorSeventh = DiatonicInterval(.descending, .minor, .seventh)
    

    Declaration

    Swift

    public init(
        _ direction: Direction,
        _ quality: Quality.Imperfect,
        _ ordinal: Number.Imperfect
    )
  • Creates an augmented or diminished DiatonicInterval with an imperfect number. These intervals can be up to quintuple augmented or diminished.

    let doubleDiminishedSecond = DiatonicInterval(.double, .diminished, .second)
    let tripleAugmentedThird = DiatonicInterval(.triple, .augmented, .third)
    

    Declaration

    Swift

    public init(
        _ degree: Quality.Extended.Degree,
        _ quality: Quality.Extended.AugmentedOrDiminished,
        _ ordinal: Number.Imperfect
    )
  • Creates an augmented or diminished DiatonicInterval with a given direction and an imperfect number. These intervals can be up to quintuple augmented or diminished.

    let doubleDiminishedSecond = DiatonicInterval(.descending, .double, .diminished, .second)
    let tripleAugmentedThird = DiatonicInterval(.ascending, .triple, .augmented, .third)
    

    Declaration

    Swift

    public init(
        _ direction: Direction,
        _ degree: Quality.Extended.Degree,
        _ quality: Quality.Extended.AugmentedOrDiminished,
        _ ordinal: Number.Imperfect
    )
  • Creates an augmented or diminished DiatonicInterval with a perfect number. These intervals can be up to quintuple augmented or diminished.

    let doubleAugmentedUnison = DiatonicInterval(.double, .augmented, .unison)
    let tripleDiminishedFourth = DiatonicInterval(.triple, .diminished, .fourth)
    

    Declaration

    Swift

    public init(
        _ degree: Quality.Extended.Degree,
        _ quality: Quality.Extended.AugmentedOrDiminished,
        _ ordinal: Number.Perfect
    )
  • Creates an augmented or diminished DiatonicInterval with a given direction and a perfect number. These intervals can be up to quintuple augmented or diminished.

    let doubleAugmentedUnison = DiatonicInterval(.descending, .double, .augmented, .unison)
    let tripleDiminishedFourth = DiatonicInterval(.ascending, .triple, .diminished, .fourth)
    

    Declaration

    Swift

    public init(
        _ direction: Direction,
        _ degree: Quality.Extended.Degree,
        _ quality: Quality.Extended.AugmentedOrDiminished,
        _ ordinal: Number.Perfect
    )
  • Creates an augmented or diminished DiatonicInterval with an imperfect number.

    let diminishedSecond = DiatonicInterval(.diminished, .second)
    let augmentedSixth = DiatonicInterval(.augmented, .sixth)
    

    Declaration

    Swift

    public init(
        _ quality: Quality.Extended.AugmentedOrDiminished,
        _ ordinal: Number.Imperfect
    )
  • Creates an augmented or diminished DiatonicInterval with a given direction and an imperfect number.

    let diminishedSecond = DiatonicInterval(.descending, .diminished, .second)
    let augmentedSixth = DiatonicInterval(.ascending, .augmented, .sixth)
    

    Declaration

    Swift

    public init(
        _ direction: Direction,
        _ quality: Quality.Extended.AugmentedOrDiminished,
        _ ordinal: Number.Imperfect
    )
  • Creates an augmented or diminished DiatonicInterval with a perfect number.

    let augmentedUnison = DiatonicInterval(.augmented, .unison)
    let diminishedFourth = DiatonicInterval(.diminished, .fourth)
    

    Declaration

    Swift

    public init(_ quality: Quality.Extended.AugmentedOrDiminished, _ ordinal: Number.Perfect)
  • Creates an augmented or diminished DiatonicInterval with a given direction and a perfect number.

    let augmentedUnison = DiatonicInterval(.ascending, .augmented, .unison)
    let diminishedFourth = DiatonicInterval(.descending, .diminished, .fourth)
    

    Declaration

    Swift

    public init(
        _ direction: Direction,
        _ quality: Quality.Extended.AugmentedOrDiminished,
        _ ordinal: Number.Perfect
    )
  • Declaration

    Swift

    public var inverse: DiatonicInterval { get }

    Return Value

    Inversion of self.

  • Printable description of UnorderedIntervalDescriptor.

    Declaration

    Swift

    public var description: String { get }