OpenSheetMusicDisplay
    Preparing search index...

    Class Pitch

    Index

    Constructors

    • Parameters

      • fundamentalNote: NoteEnum
      • octave: number
      • accidental: AccidentalEnum
      • accidentalXml: string = undefined
      • isRest: boolean = false
      • octaveShiftApplied: boolean = undefined

      Returns Pitch

    Properties

    OctaveShiftApplied: boolean
    pitchEnumValues: NoteEnum[] = ...

    Accessors

    • get ToStringShortGet(): string

      A shortcut getter for ToStringShort that can be useful for debugging.

      Returns string

    Methods

    • A short representation of the note like A4 (A, octave 4), Ab5 or C#4.

      Parameters

      • octaveOffset: number = 0

      Returns string

    • Converts AccidentalEnum to a string which represents an accidental in VexFlow Can also be useful in other cases, but has to match Vexflow accidental codes.

      Parameters

      Returns string

      Vexflow Accidental code

    • Parameters

      • pitch: Pitch
      • transpose: number

      Returns { halftone: number; overflow: number }

      ret[0] = the transposed fundamental. ret[1] = the octave shift (not the new octave!)

    • Changes a note x lines/steps up (+) or down (-) from a NoteEnum on a staffline/keyboard (white keys). E.g. Two lines down (-2) from a D is a B. Two lines up from an A is a C. (e.g. in the treble/violin clef, going one line up: E -> F (semitone), F -> G (2 semitones)). Returns new NoteEnum and the octave shift (e.g. -1 = new octave is one octave down).

      Parameters

      Returns [NoteEnum, number]

    • Returns the fundamental note x (0 <= x <= 11, e.g. 0 = C) with octave change/overflow. The halftone will be one of the values in the enum NoteEnum, converted to number here as we need numbers for calculation.

      Parameters

      • value: number
      • limit: number

      Returns { halftone: number; overflow: number }