Number

public enum Number : DiatonicIntervalNumber

Ordinal for DiatonicInterval.

  • Perfect ordered interval ordinal (unison, fourth, or fifth).

    Declaration

    Swift

    case perfect(Perfect)
  • Imperfect ordered interval ordinal (second, third, sixth, or seventh).

    Declaration

    Swift

    case imperfect(Imperfect)
  • Declaration

    Swift

    public var inverse: DiatonicInterval.Number { get }

    Return Value

    Inversion of self.

    let third: Ordinal = .imperfect(.third) third.inverse // => .imperfect(.sixth) let fifth: Ordinal = .perfect(.fifth) fifth.inverse // => .perfect(.fourth)

  • The amount of diatonic steps represented by this OrderedIntervalDescriptor.Ordinal.

    Declaration

    Swift

    public var steps: Int { get }
  • Declaration

    Swift

    public var augDimThreshold: Double { get }

    Return Value

    The distance in semitones from an ideal interval at which point an interval quality becomes diminished or augmented for a given Ordinal.

  • Declaration

    Swift

    public static func distanceToIdealInterval(for steps: Int, to interval: Double) -> Double

    Return Value

    The distance from the given interval to the ideal interval for the given amount of steps.