Frequency
public struct Frequency : NewType, SignedNumeric
Periodic vibration in Hertz.
Example Usage
let nice = Frequency(440.0) // => "a 440"
let mean: Frequency = 440.0 // => "a 440"
-
The value of this
Frequency
in Hz (i.e., cycles per second).Declaration
Swift
public let value: Double
-
Creates a
Frequency
with the givenvalue
in Hz (i.e., cycles per second).Declaration
Swift
public init(value: Double)
-
Creates a
Frequency
from the givennoteNumber
, using the given referenceFrequency
for the given referenceNoteNumber
.Declaration
Swift
public init(noteNumber: NoteNumber, with freqRef: Frequency = <<empty>>, at nnRef: NoteNumber)
-
Declaration
Swift
public func noteNumber(with freqRef: Frequency = <<empty>>, at nnRef: NoteNumber = <<empty>>) -> NoteNumber
Return Value
A
NoteNumber
representation of thisFrequency
, using the given referenceFrequency
for the given referenceNoteNumber
.
-
Creates a
Frequency
with the givenratio
and the givenreference
Frequency
.Declaration
Swift
public init(_ ratio: Fraction, reference: Frequency)