SpelledPitch

public struct SpelledPitch

A Pitch.Spelling in a specific octave.

  • The Pitch.Spelling defining a SpelledPitch.

    Declaration

    Swift

    public let spelling: Pitch.Spelling
  • The octave defining a SpelledPitch

    Declaration

    Swift

    public let octave: Int
  • The c natural nearest to the middle of an 88-key piano.

    Declaration

    Swift

    public static var middleC: SpelledPitch { get }
  • Creates a SpelledPitch with a given spelling in displaced by the given octave.

    Declaration

    Swift

    public init(_ spelling: Pitch.Spelling, _ octave: Int = 4)
  • Declaration

    Swift

    public var pitch: Pitch { get }

    Return Value

    The Pitch value represented by this SpelledPitch.

  • Declaration

    Swift

    public func displaced(by interval: OrderedIntervalDescriptor) -> SpelledPitch

    Return Value

    A SpelledPitch which is displaced by the given interval.

  • Declaration

    Swift

    public func displaced(by interval: CompoundIntervalDescriptor) -> SpelledPitch

    Return Value

    A SpelledPitch which is displaced by the given interval.

  • Note

    In the case that both values are in the same octave, true is returned if the spelling of the SpelledPitch value on the left is less than that of the SpelledPitch on the right. This manages extreme scenarios such as (c#, dbb), which should have a named interval of a double diminished second, not a double augmented seventh.

    Declaration

    Swift

    public static func < (lhs: SpelledPitch, rhs: SpelledPitch) -> Bool

    Return Value

    true if the pitch value of the SpelledPitch value on the left is less than that of the SpelledPitch value on the right. Otherwise, false.