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
-
The
NoteNumberrepresentation of thisPitch.Declaration
Swift
public let value: NoteNumber
-
Creates a
Pitchwith the givenNoteNumbervalue.Declaration
Swift
public init(_ value: NoteNumber) -
Creates a
Pitchwith the givenintvalue.Declaration
Swift
public init(_ int: Int)
-
Declaration
Swift
public struct Class : NoteNumberRepresentable
-
Creates a
Pitchwith the givenPitch.Class.Declaration
Swift
public init(_ pitchClass: Pitch.Class)
-
Declaration
Swift
public var `class`: Pitch.Class { get }Return Value
The
mod 12representation of thisPitch.
-
The
Frequencyrepresentation of thisPitch, with the given tuningreferenceFrequencyat the givenreferenceNoteNumber.Declaration
Swift
public func frequency(referenceFrequency: Frequency = 440, referenceNoteNumber: NoteNumber = 69) -> Frequency
-
Printable description of
Pitch.Declaration
Swift
public var description: String { get }
View on GitHub
Install in Dash
Pitch Structure Reference