Interval

public struct Interval : Hashable, Sendable

The structure for an interval

  • Quality of the interval

    Declaration

    Swift

    public var quality: Quality
  • Degree of the interval

    Declaration

    Swift

    public var degree: Int
  • Semitones interval affect on a pitch

    Declaration

    Swift

    public var semitones: Int
  • P1

    Unison

    Declaration

    Swift

    public static let P1: Interval
  • P4

    Perfect fourth

    Declaration

    Swift

    public static let P4: Interval
  • P5

    Perfect fifth

    Declaration

    Swift

    public static let P5: Interval
  • P8

    Octave

    Declaration

    Swift

    public static let P8: Interval
  • P11

    Perfect eleventh

    Declaration

    Swift

    public static let P11: Interval
  • P12

    Perfect twelfth

    Declaration

    Swift

    public static let P12: Interval
  • P15

    Perfect fifteenth, double octave

    Declaration

    Swift

    public static let P15: Interval
  • m2

    Minor second

    Declaration

    Swift

    public static let m2: Interval
  • m3

    Minor third

    Declaration

    Swift

    public static let m3: Interval
  • m6

    Minor sixth

    Declaration

    Swift

    public static let m6: Interval
  • m7

    Minor seventh

    Declaration

    Swift

    public static let m7: Interval
  • m9

    Minor ninth

    Declaration

    Swift

    public static let m9: Interval
  • m10

    Minor tenth

    Declaration

    Swift

    public static let m10: Interval
  • m13

    Minor thirteenth

    Declaration

    Swift

    public static let m13: Interval
  • m14

    Minor fourteenth

    Declaration

    Swift

    public static let m14: Interval
  • M2

    Major second

    Declaration

    Swift

    public static let M2: Interval
  • M3

    Major third

    Declaration

    Swift

    public static let M3: Interval
  • M6

    Major sixth

    Declaration

    Swift

    public static let M6: Interval
  • M7

    Major seventh

    Declaration

    Swift

    public static let M7: Interval
  • M9

    Major ninth

    Declaration

    Swift

    public static let M9: Interval
  • M10

    Major tenth

    Declaration

    Swift

    public static let M10: Interval
  • M13

    Major thirteenth

    Declaration

    Swift

    public static let M13: Interval
  • M14

    Major fourteenth

    Declaration

    Swift

    public static let M14: Interval
  • d1

    Diminished first

    Declaration

    Swift

    public static let d1: Interval
  • d2

    Diminished second

    Declaration

    Swift

    public static let d2: Interval
  • d3

    Diminished third

    Declaration

    Swift

    public static let d3: Interval
  • d4

    Diminished fourth

    Declaration

    Swift

    public static let d4: Interval
  • d5

    Diminished fifth

    Declaration

    Swift

    public static let d5: Interval
  • d6

    Diminished sixth

    Declaration

    Swift

    public static let d6: Interval
  • d7

    Diminished seventh

    Declaration

    Swift

    public static let d7: Interval
  • d8

    Diminished eighth

    Declaration

    Swift

    public static let d8: Interval
  • d9

    Diminished ninth

    Note

    Changed 12 to 13

    Declaration

    Swift

    public static let d9: Interval
  • d10

    Diminished tenth

    Declaration

    Swift

    public static let d10: Interval
  • d11

    Diminished eleventh

    Declaration

    Swift

    public static let d11: Interval
  • d12

    Diminished twelfth

    Declaration

    Swift

    public static let d12: Interval
  • d13

    Diminished thirteenth

    Declaration

    Swift

    public static let d13: Interval
  • d14

    Diminished fourteenth

    Declaration

    Swift

    public static let d14: Interval
  • d15

    Diminished fifteenth

    Declaration

    Swift

    public static let d15: Interval
  • A1

    Augmented first

    Declaration

    Swift

    public static let A1: Interval
  • A2

    Augmented second

    Declaration

    Swift

    public static let A2: Interval
  • A3

    Augmented third

    Declaration

    Swift

    public static let A3: Interval
  • A4

    Augmented fourth

    Declaration

    Swift

    public static let A4: Interval
  • A5

    Augmented fifth

    Declaration

    Swift

    public static let A5: Interval
  • A6

    Augmented sixth

    Declaration

    Swift

    public static let A6: Interval
  • A7

    Augmented seventh

    Declaration

    Swift

    public static let A7: Interval
  • A8

    Augmented octave

    Declaration

    Swift

    public static let A8: Interval
  • A9

    Augmented ninth

    Declaration

    Swift

    public static let A9: Interval
  • A10

    Augmented tenth

    Declaration

    Swift

    public static let A10: Interval
  • A11

    Augmented eleventh

    Declaration

    Swift

    public static let A11: Interval
  • A12

    Augmented twelfth

    Declaration

    Swift

    public static let A12: Interval
  • A13

    Augmented thirteenth

    Declaration

    Swift

    public static let A13: Interval
  • A14

    Augmented fourteenth

    Declaration

    Swift

    public static let A14: Interval
  • A15

    Augmented fifteenth

    Declaration

    Swift

    public static let A15: Interval

CustomStringConvertible

  • Returns the notation of the interval.

    Declaration

    Swift

    public var notation: String { get }
  • Returns the name of the interval.

    Declaration

    Swift

    public var description: String { get }
  • The quality of the interval

    See more

    Declaration

    Swift

    enum Quality : Sendable