CompoundDiatonicInterval
public struct CompoundDiatonicInterval : DiatonicIntervalProtocol
A descriptor for intervals between two Pitch
values which takes into account octave
displacement.
-
The base interval descriptor.
Declaration
Swift
public let interval: DiatonicInterval
-
The amount of octaves displaced.
Declaration
Swift
public let octaveDisplacement: Int
-
Creates a
CompoundDiatonicInterval
with the giveninterval
and the amount ofoctaves
of displacement.Declaration
Swift
public init(_ interval: DiatonicInterval, displacedBy octaves: Int = 0)
-
Creates a
CompoundDiatonicInterval
with the givenquality
and the givennumber
, with no octave displacement.Declaration
Swift
public init(_ quality: Quality, _ ordinal: DiatonicInterval.Number)
-
Declaration
Swift
public var semitones: Int { get }
Return Value
The amount of semitones in this
CompoundIntervalDescriptor
. -
Declaration
Swift
public var steps: Int { get }
Return Value
The amount of letter name steps in this
CompoundIntervalDescriptor
.
-
The
unison
is thezero
for theCompoundIntervalDescriptor
AdditiveGroup
.Declaration
Swift
public static let zero: CompoundDiatonicInterval
-
Example Usage:
let perfectFifth: CompoundDiatonicInterval = .P5 let minorThird: CompoundDiatonicInterval = .m3 let minorSeventh = perfectFifth + minorThird // => .m7
Declaration
Swift
public static func + (lhs: CompoundDiatonicInterval, rhs: CompoundDiatonicInterval) -> CompoundDiatonicInterval
Return Value
The sum of the given
CompoundIntervalDescriptors
. -
Mutates the left-hand-side by adding the right-hand-side.
Declaration
Swift
public static func += (lhs: inout CompoundDiatonicInterval, rhs: CompoundDiatonicInterval)
-
Example Usage:
let perfectFifth: CompoundDiatonicInterval = .P5 let minorThird: CompoundDiatonicInterval = .m3 let majorThird = perfectFifth - minorThird // => .M3
Declaration
Swift
public static func - (lhs: CompoundDiatonicInterval, rhs: CompoundDiatonicInterval) -> CompoundDiatonicInterval
Return Value
The sum of the given
CompoundIntervalDescriptors
. -
Mutates the left-hand-side by subtracting the right-hand-side.
Declaration
Swift
public static func -= (lhs: inout CompoundDiatonicInterval, rhs: CompoundDiatonicInterval)
-
Declaration
Swift
public prefix static func - (element: CompoundDiatonicInterval) -> CompoundDiatonicInterval
Return Value
The
inverse
of aCompoundDiatonicInterval
. -
Declaration
Swift
public var inverse: CompoundDiatonicInterval { get }
Return Value
The
inverse
of aCompoundIntervalDescriptor
.
-
Diminished Unison.
Declaration
Swift
public static let d1: CompoundDiatonicInterval
-
Unison.
Declaration
Swift
public static let unison: CompoundDiatonicInterval
-
Diminished second.
Declaration
Swift
public static let d2: CompoundDiatonicInterval
-
Augmented unison.
Declaration
Swift
public static let A1: CompoundDiatonicInterval
-
Minor second.
Declaration
Swift
public static let m2: CompoundDiatonicInterval
-
Major second.
Declaration
Swift
public static let M2: CompoundDiatonicInterval
-
Diminished third.
Declaration
Swift
public static let d3: CompoundDiatonicInterval
-
Augmented second.
Declaration
Swift
public static let A2: CompoundDiatonicInterval
-
Minor third.
Declaration
Swift
public static let m3: CompoundDiatonicInterval
-
Major third.
Declaration
Swift
public static let M3: CompoundDiatonicInterval
-
Diminished fourth.
Declaration
Swift
public static let d4: CompoundDiatonicInterval
-
Augmented third.
Declaration
Swift
public static let A3: CompoundDiatonicInterval
-
Perfect fourth.
Declaration
Swift
public static let P4: CompoundDiatonicInterval
-
Augmented fourth.
Declaration
Swift
public static let A4: CompoundDiatonicInterval
-
Diminished fifth.
Declaration
Swift
public static let d5: CompoundDiatonicInterval
-
Perfect fifth.
Declaration
Swift
public static let P5: CompoundDiatonicInterval
-
Diminished sixth.
Declaration
Swift
public static let d6: CompoundDiatonicInterval
-
Augmented fifth.
Declaration
Swift
public static let A5: CompoundDiatonicInterval
-
Minor sixth.
Declaration
Swift
public static let m6: CompoundDiatonicInterval
-
Major sixth.
Declaration
Swift
public static let M6: CompoundDiatonicInterval
-
Diminished seventh.
Declaration
Swift
public static let d7: CompoundDiatonicInterval
-
Augmented sixth.
Declaration
Swift
public static let A6: CompoundDiatonicInterval
-
Minor seventh.
Declaration
Swift
public static let m7: CompoundDiatonicInterval
-
Major seventh.
Declaration
Swift
public static let M7: CompoundDiatonicInterval
-
Octave.
Declaration
Swift
public static let octave: CompoundDiatonicInterval
-
Augmented seventh.
Declaration
Swift
public static let A7: CompoundDiatonicInterval
-
Diminished octave.
Declaration
Swift
public static let d8: CompoundDiatonicInterval
-
Diminished ninth.
Declaration
Swift
public static let d9: CompoundDiatonicInterval
-
Augmented octave.
Declaration
Swift
public static let A8: CompoundDiatonicInterval
-
Minor ninth.
Declaration
Swift
public static let m9: CompoundDiatonicInterval
-
Major ninth.
Declaration
Swift
public static let M9: CompoundDiatonicInterval
-
Diminished tenth.
Declaration
Swift
public static let d10: CompoundDiatonicInterval
-
Augmented ninth.
Declaration
Swift
public static let A9: CompoundDiatonicInterval
-
Minor tenth.
Declaration
Swift
public static let m10: CompoundDiatonicInterval
-
Major tenth.
Declaration
Swift
public static let M10: CompoundDiatonicInterval
-
Diminished eleventh.
Declaration
Swift
public static let d11: CompoundDiatonicInterval
-
Perfect eleventh.
Declaration
Swift
public static let P11: CompoundDiatonicInterval
-
Augmented eleventh.
Declaration
Swift
public static let A11: CompoundDiatonicInterval
-
Diminished twelfth.
Declaration
Swift
public static let d12: CompoundDiatonicInterval
-
Perfect twelfth.
Declaration
Swift
public static let P12: CompoundDiatonicInterval
-
Diminished thirteenth.
Declaration
Swift
public static let d13: CompoundDiatonicInterval
-
Augmented twelfth.
Declaration
Swift
public static let A12: CompoundDiatonicInterval
-
Minor thirteenth.
Declaration
Swift
public static let m13: CompoundDiatonicInterval
-
Major thirteenth.
Declaration
Swift
public static let M13: CompoundDiatonicInterval
-
Diminished fourteenth.
Declaration
Swift
public static let d14: CompoundDiatonicInterval
-
Augmented thirteenth.
Declaration
Swift
public static let A13: CompoundDiatonicInterval
-
Minor fourteenth.
Declaration
Swift
public static let m14: CompoundDiatonicInterval
-
Major fourteenth.
Declaration
Swift
public static let M14: CompoundDiatonicInterval
-
Augmented fourteenth.
Declaration
Swift
public static let A14: CompoundDiatonicInterval
-
Printable description of CompoundIntervalDescriptor.
Declaration
Swift
public var description: String { get }