ChordDescriptor
public struct ChordDescriptor
Description of a simultaneity of pitches wherein the intervals between the pitches are described.
Example Usage
let major: ChordDescriptor = [.M3, .m3]
let minor: ChordDescriptor = [.m3, .M3]
let diminished: ChordDescriptor = [.m3, .m3]
let augmented: ChordDescriptor = [.M3, .M3]
-
Creates a
ChordDescriptor
with the givenintervals
.Declaration
Swift
public init(_ intervals: [CompoundDiatonicInterval])
-
Example Usage:
let major: ChordDescriptor = [.M3, .m3] let firstInversion = major.inversion(1) // => [.m3, .P4] let secondInversion = major.inversion(2) // => [.P4, .M3] let majorSeventh: ChordDescriptor = [.M3, .m3, .M3] let thirdInversion = majorSeventh.inversion(3) // => [.m2, .M3, .m3]
Declaration
Swift
public func inversion(_ value: Int) -> ChordDescriptor
Return Value
A
ChordDescriptor
which is the nth inversion of thisChordDescriptor
.
-
Undocumented
Declaration
Swift
public static let major: ChordDescriptor
-
Undocumented
Declaration
Swift
public static let minor: ChordDescriptor
-
Undocumented
Declaration
Swift
public static let diminished: ChordDescriptor
-
Undocumented
Declaration
Swift
public static let augmented: ChordDescriptor
-
Declaration
Swift
public var base: [CompoundDiatonicInterval] { get }
Return Value
The
RandomAccessCollection
base of aChordDescriptor
.
-
Undocumented
Declaration
Swift
public typealias Base = [CompoundDiatonicInterval]
-
Start index.
Complexity
O(1)Declaration
Swift
public var startIndex: Base.Index { get }
-
End index.
Complexity
O(1)Declaration
Swift
public var endIndex: Base.Index { get }
-
First element, if there is at least one element. Otherwise,
nil
.Complexity
O(1)Declaration
Swift
public var first: Base.Element? { get }
-
Last element, if there is at least one element. Otherwise,
nil
.Complexity
O(1)Declaration
Swift
public var last: Base.Element? { get }
-
Amount of elements.
Complexity
O(1)Declaration
Swift
public var count: Int { get }
-
Complexity
O(1)
Declaration
Swift
public var isEmpty: Bool { get }
Return Value
true
if there are no elements contained herein. Otherwise,false
.
-
Creates a
ChordDescriptor
with the given array literal ofCompoundDiatonicInterval
values.Declaration
Swift
public init(arrayLiteral intervals: CompoundDiatonicInterval...)