Pitch

public struct Pitch : NoteNumberRepresentable

The quality of a sound governed by the rate of vibrations producing it.

A Pitch is represented by a NoteNumber value. If offers an interface to represent this NoteNumber as a Frequency given different tuning conventions.

Example Usage

let middle = Pitch(60) // => middle c
let high = Pitch(84) // => two octaves above middle c
let lower = Pitch(69) // => a 440
  • Creates a Pitch with the given NoteNumber value.

    Declaration

    Swift

    public init(_ value: NoteNumber)
  • Creates a Pitch with the given int value.

    Declaration

    Swift

    public init(_ int: Int)
  • Declaration

    Swift

    public var `class`: Pitch.Class { get }

    Return Value

    The mod 12 representation of this Pitch.

  • Declaration

    Swift

    public static var zero: Pitch { get }
  • Printable description of Pitch.

    Declaration

    Swift

    public var description: String { get }