OrderedInterval
public struct OrderedInterval<Element> : NoteNumberRepresentable where Element : NoteNumberRepresentable
The ordered interval between two NoteNumberRepresentable
-conforming type values.
-
The underlying
NoteNumber
value for thisOrderedInterval
.Declaration
Swift
public let value: NoteNumber
-
Creates an
OrderedInterval
with the givennoteNumber
value.Declaration
Swift
public init(_ noteNumber: NoteNumber)
-
Creates an
OrderedInterval
between the two givenNoteNumberRepresentable
-conforming type values.Example Usage
let ray: Pitch = 62 let tea: Pitch = 59 let _ = OrderedInterval(ray,tea) // => -3
Declaration
Swift
public init(_ a: Element, _ b: Element)