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
-
Unison
Declaration
Swift
public static let P1 = Interval(quality: .perfect, degree: 1, semitones: 0)
-
Perfect fourth
Declaration
Swift
public static let P4 = Interval(quality: .perfect, degree: 4, semitones: 5)
-
Perfect fifth
Declaration
Swift
public static let P5 = Interval(quality: .perfect, degree: 5, semitones: 7)
-
Octave
Declaration
Swift
public static let P8 = Interval(quality: .perfect, degree: 8, semitones: 12)
-
Perfect eleventh
Declaration
Swift
public static let P11 = Interval(quality: .perfect, degree: 11, semitones: 17)
-
Perfect twelfth
Declaration
Swift
public static let P12 = Interval(quality: .perfect, degree: 12, semitones: 19)
-
Perfect fifteenth, double octave
Declaration
Swift
public static let P15 = Interval(quality: .perfect, degree: 15, semitones: 24)
-
Minor second
Declaration
Swift
public static let m2 = Interval(quality: .minor, degree: 2, semitones: 1)
-
Minor third
Declaration
Swift
public static let m3 = Interval(quality: .minor, degree: 3, semitones: 3)
-
Minor sixth
Declaration
Swift
public static let m6 = Interval(quality: .minor, degree: 6, semitones: 8)
-
Minor seventh
Declaration
Swift
public static let m7 = Interval(quality: .minor, degree: 7, semitones: 10)
-
Minor ninth
Declaration
Swift
public static let m9 = Interval(quality: .minor, degree: 9, semitones: 13)
-
Minor tenth
Declaration
Swift
public static let m10 = Interval(quality: .minor, degree: 10, semitones: 15)
-
Minor thirteenth
Declaration
Swift
public static let m13 = Interval(quality: .minor, degree: 13, semitones: 20)
-
Minor fourteenth
Declaration
Swift
public static let m14 = Interval(quality: .minor, degree: 14, semitones: 22)
-
Major second
Declaration
Swift
public static let M2 = Interval(quality: .major, degree: 2, semitones: 2)
-
Major third
Declaration
Swift
public static let M3 = Interval(quality: .major, degree: 3, semitones: 4)
-
Major sixth
Declaration
Swift
public static let M6 = Interval(quality: .major, degree: 6, semitones: 9)
-
Major seventh
Declaration
Swift
public static let M7 = Interval(quality: .major, degree: 7, semitones: 11)
-
Major ninth
Declaration
Swift
public static let M9 = Interval(quality: .major, degree: 9, semitones: 14)
-
Major tenth
Declaration
Swift
public static let M10 = Interval(quality: .major, degree: 10, semitones: 16)
-
Major thirteenth
Declaration
Swift
public static let M13 = Interval(quality: .major, degree: 13, semitones: 21)
-
Major fourteenth
Declaration
Swift
public static let M14 = Interval(quality: .major, degree: 14, semitones: 23)
-
Diminished first
Declaration
Swift
public static let d1 = Interval(quality: .diminished, degree: 1, semitones: -1)
-
Diminished second
Declaration
Swift
public static let d2 = Interval(quality: .diminished, degree: 2, semitones: 0)
-
Diminished third
Declaration
Swift
public static let d3 = Interval(quality: .diminished, degree: 3, semitones: 2)
-
Diminished fourth
Declaration
Swift
public static let d4 = Interval(quality: .diminished, degree: 4, semitones: 4)
-
Diminished fifth
Declaration
Swift
public static let d5 = Interval(quality: .diminished, degree: 5, semitones: 6)
-
Diminished sixth
Declaration
Swift
public static let d6 = Interval(quality: .diminished, degree: 6, semitones: 7)
-
Diminished seventh
Declaration
Swift
public static let d7 = Interval(quality: .diminished, degree: 7, semitones: 9)
-
Diminished eighth
Declaration
Swift
public static let d8 = Interval(quality: .diminished, degree: 8, semitones: 11)
-
Diminished ninth
Note
Changed 12 to 13Declaration
Swift
public static let d9 = Interval(quality: .diminished, degree: 9, semitones: 13)
-
Diminished tenth
Declaration
Swift
public static let d10 = Interval(quality: .diminished, degree: 10, semitones: 14)
-
Diminished eleventh
Declaration
Swift
public static let d11 = Interval(quality: .diminished, degree: 11, semitones: 16)
-
Diminished twelfth
Declaration
Swift
public static let d12 = Interval(quality: .diminished, degree: 12, semitones: 18)
-
Diminished thirteenth
Declaration
Swift
public static let d13 = Interval(quality: .diminished, degree: 13, semitones: 19)
-
Diminished fourteenth
Declaration
Swift
public static let d14 = Interval(quality: .diminished, degree: 14, semitones: 21)
-
Diminished fifteenth
Declaration
Swift
public static let d15 = Interval(quality: .diminished, degree: 15, semitones: 23)
-
Augmented first
Declaration
Swift
public static let A1 = Interval(quality: .augmented, degree: 1, semitones: 1)
-
Augmented second
Declaration
Swift
public static let A2 = Interval(quality: .augmented, degree: 2, semitones: 3)
-
Augmented third
Declaration
Swift
public static let A3 = Interval(quality: .augmented, degree: 3, semitones: 5)
-
Augmented fourth
Declaration
Swift
public static let A4 = Interval(quality: .augmented, degree: 4, semitones: 6)
-
Augmented fifth
Declaration
Swift
public static let A5 = Interval(quality: .augmented, degree: 5, semitones: 8)
-
Augmented sixth
Declaration
Swift
public static let A6 = Interval(quality: .augmented, degree: 6, semitones: 10)
-
Augmented seventh
Declaration
Swift
public static let A7 = Interval(quality: .augmented, degree: 7, semitones: 12)
-
Augmented octave
Declaration
Swift
public static let A8 = Interval(quality: .augmented, degree: 8, semitones: 13)
-
Augmented ninth
Declaration
Swift
public static let A9 = Interval(quality: .augmented, degree: 9, semitones: 15)
-
Augmented tenth
Declaration
Swift
public static let A10 = Interval(quality: .augmented, degree: 10, semitones: 17)
-
Augmented eleventh
Declaration
Swift
public static let A11 = Interval(quality: .augmented, degree: 11, semitones: 18)
-
Augmented twelfth
Declaration
Swift
public static let A12 = Interval(quality: .augmented, degree: 12, semitones: 20)
-
Augmented thirteenth
Declaration
Swift
public static let A13 = Interval(quality: .augmented, degree: 13, semitones: 22)
-
Augmented fourteenth
Declaration
Swift
public static let A14 = Interval(quality: .augmented, degree: 14, semitones: 24)
-
Augmented fifteenth
Declaration
Swift
public static let A15 = Interval(quality: .augmented, degree: 15, semitones: 25)
-
Returns the notation of the interval.
Declaration
Swift
public var notation: String
-
Returns the name of the interval.
Declaration
Swift
public var description: String
-
The quality of the interval
See moreDeclaration
Swift
enum Quality: Sendable