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 aOrderedIntervalDescriptor
.(e.g.,
.unison
,.second
,.third
,.fourth
,.fifth
,.sixth
,.seventh
).Declaration
Swift
public let number: Number
-
The
DiatonicIntervalQuality
value of aOrderedIntervalDescriptor
.(e.g.,
.diminished
,.minor
,.perfect
,.major
,.augmented
).Declaration
Swift
public let quality: Quality
-
Ordinal for
See moreDiatonicInterval
.Declaration
Swift
public enum Number : DiatonicIntervalNumber
-
Direction of a
See moreDiatonicInterval
.Declaration
Swift
public enum Direction : InvertibleEnum
-
Creates an
DiatonicInterval
with the given unordered one.Declaration
Swift
public init(_ unordered: UnorderedDiatonicInterval)
-
Creates an
DiatonicInterval
with the given compound one.Declaration
Swift
public init(_ compound: CompoundDiatonicInterval)
-
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
.
-
Diminished unison.
Declaration
Swift
public static let d1: DiatonicInterval
-
Unison.
Declaration
Swift
public static let unison: DiatonicInterval
-
Diminished second.
Declaration
Swift
public static let d2: DiatonicInterval
-
Augmented Unison.
Declaration
Swift
public static let A1: DiatonicInterval
-
Minor second.
Declaration
Swift
public static let m2: DiatonicInterval
-
Major second.
Declaration
Swift
public static let M2: DiatonicInterval
-
Diminished third.
Declaration
Swift
public static let d3: DiatonicInterval
-
Augmented second.
Declaration
Swift
public static let A2: DiatonicInterval
-
Minor third.
Declaration
Swift
public static let m3: DiatonicInterval
-
Major third.
Declaration
Swift
public static let M3: DiatonicInterval
-
Diminished fourth.
Declaration
Swift
public static let d4: DiatonicInterval
-
Augmented third.
Declaration
Swift
public static let A3: DiatonicInterval
-
Perfect fourth.
Declaration
Swift
public static let P4: DiatonicInterval
-
Augmented fourth.
Declaration
Swift
public static let A4: DiatonicInterval
-
Diminished fifth
Declaration
Swift
public static let d5: DiatonicInterval
-
Perfect fifth.
Declaration
Swift
public static let P5: DiatonicInterval
-
Diminished sixth.
Declaration
Swift
public static let d6: DiatonicInterval
-
Augmented fifth.
Declaration
Swift
public static let A5: DiatonicInterval
-
Minor sixth.
Declaration
Swift
public static let m6: DiatonicInterval
-
Major sixth.
Declaration
Swift
public static let M6: DiatonicInterval
-
Diminished seventh.
Declaration
Swift
public static let d7: DiatonicInterval
-
Augmented sixth.
Declaration
Swift
public static let A6: DiatonicInterval
-
Minor seventh.
Declaration
Swift
public static let m7: DiatonicInterval
-
Major seventh.
Declaration
Swift
public static let M7: DiatonicInterval
-
Augmented seventh.
Declaration
Swift
public static let A7: DiatonicInterval
-
The
.unison
is theAdditive
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 a perfect
DiatonicInterval
.let perfectFifth = DiatonicInterval(.perfect, .fifth)
Declaration
Swift
public init(_ 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)
-
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 givendirection
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)
-
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 givendirection
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)
-
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 givendirection
and an imperfect number.let diminishedSecond = DiatonicInterval(.descending, .diminished, .second) let augmentedSixth = DiatonicInterval(.ascending, .augmented, .sixth)
-
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 givendirection
and a perfect number.let augmentedUnison = DiatonicInterval(.ascending, .augmented, .unison) let diminishedFourth = DiatonicInterval(.descending, .diminished, .fourth)
-
Declaration
Swift
public var inverse: DiatonicInterval { get }
Return Value
Inversion of
self
.
-
Printable description of UnorderedIntervalDescriptor.
Declaration
Swift
public var description: String { get }