Dyad
public struct Dyad<Element> where Element : NoteNumberRepresentable
An ordered pair of NoteNumberRepresentable
-conforming type values.
Example Usage
let good = Dyad(Pitch(60),Pitch(69))
let bad = Dyad(Pitch(60),Pitch(66))
let ugly = Dyad(Pitch(60,Pitch(65.5))
-
The lower
NoteNumberRepresentable
-conforming type value.Declaration
Swift
public let lower: Element
-
The higher
NoteNumberRepresentable
-conforming type value.Declaration
Swift
public let higher: Element
-
Declaration
Swift
public var interval: OrderedInterval<Element> { get }
Return Value
The
OrderedInterval
of these twoNoteNumberRepresentable
-conforming type values.
-
Creates a
Dyad
with the twoNoteNumberRepresentable
-conforming type values.The values are ordered automatically.
Example Usage
let inOrder = Dyad(Pitch(60),Pitch(61)) // => (60,61) let outOfOrder = Dyad(Pitch(61),Pitch(60)) //=> (60,61)
Declaration
Swift
public init(_ a: Element, _ b: Element)
-
Printed description of a
Dyad
.Declaration
Swift
public var description: String { get }