Pitch
public struct Pitch: Equatable
The Pitch type represents both a pitch class and an octave. It also contains a MIDI note number representation. Absolute pitch parity can be checked with ==, pitch class parity can be checked with ~=.
-
The underlying pitch class.
Declaration
Swift
public var pc: PitchClass = 0 -
The underlying octave.
Declaration
Swift
public var oct: Int = 0 -
A MIDI note number representation, for practical purposes.
Declaration
Swift
public var midiValue: UInt8 -
Initialize from a PitchClass and an integer denoting octave.
Declaration
Swift
public init(_ pitchClass: PitchClass, _ octave: Int) -
Initialize from a PitchLetter and an integer denoting octave.
Declaration
Swift
public init(_ pitchLetter: PitchLetter, _ octave: Int) -
Initialize from a MIDI note number.
Declaration
Swift
public init(_ midiNote: UInt8) -
Initialize from a description string, e.g. Pitch(
Eb5
).Declaration
Swift
public init?(_ description: String) -
Declaration
Swift
public static func ==(lhs: Pitch, rhs: Pitch) -> Bool -
Undocumented
Declaration
Swift
public static func ~=(lhs: Pitch, rhs: Pitch) -> Bool
View on GitHub
Pitch Structure Reference