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))
  • Creates a Dyad with the two NoteNumberRepresentable-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 }