UnorderedInterval
public struct UnorderedInterval<Element> : NoteNumberRepresentable where Element : NoteNumberRepresentable
The unordered interval between two NoteNumberRepresentable
-conforming type values.
-
The underlying
NoteNumber
value for thisUnorderedInterval
.Declaration
Swift
public let value: NoteNumber
-
Creates an
UnorderedInterval
with the givennoteNumber
value.Declaration
Swift
public init(_ noteNumber: NoteNumber)
-
Creates an
UnorderedInterval
between the two givenNoteNumberRepresentable
-conforming type values.Example Usage
let dough: Pitch = 60 let may: Pitch = 63 let _ = UnorderedInterval(dough,may) // => 3 let soul: Pitch = 67 let lay: Pitch = 56 let _ = UnorderedInterval(soul,lay) // => 11
Declaration
Swift
public init(_ a: Element, _ b: Element)