NoteNumber

public struct NoteNumber:
    NewType,
    Comparable,
    SignedNumeric,
    ExpressibleByFloatLiteral,
    ExpressibleByIntegerLiteral

Floating point analog to the MIDI note number.

Similarly to the MIDI note number, middle c is represented as 60. Each octave is represented by a distance of 12, thus 48 is the c below middle c, and 72 is the c above middle c.

Example Usage

let warm = NoteNumber(60)
let cold: NoteNumber = 60
  • The value of a note number (a floating point analog to the MIDI note number).

    Declaration

    Swift

    public let value: Double
  • Creates a NoteNumber with the given value.

    Declaration

    Swift

    public init(value: Double)
  • Create a NoteNumber with the given int value.

    Declaration

    Swift

    public init(_ int: Int)
  • Printable description of NoteNumber.

    Declaration

    Swift

    public var description: String { get }