Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Pitch

Index

Constructors

Properties

accidental: AccidentalEnum = AccidentalEnum.NONE
accidentalXml: string
frequency: number
fundamentalNote: NoteEnum
halfTone: number
octave: number
halftoneFactor: number = ...
octXmlDiff: number = 3
pitchEnumValues: NoteEnum[] = ...

Accessors

  • get AccidentalHalfTones(): number
  • get AccidentalXml(): string
  • get Frequency(): number
  • get Octave(): number
  • get ToStringShortGet(): string
  • get OctaveXmlDifference(): number

Methods

  • DoEnharmonicChange(): void
  • OperatorEquals(p2: Pitch): boolean
  • OperatorFundamentalGreaterThan(p2: Pitch): boolean
  • OperatorFundamentalLessThan(p2: Pitch): boolean
  • OperatorNotEqual(p2: Pitch): boolean
  • ToString(): string
  • ToStringShort(octaveOffset?: number): string
  • A short representation of the note like A4 (A, octave 4), Ab5 or C#4.

    Parameters

    • octaveOffset: number = 0

    Returns string

  • getHalfTone(): number
  • getHigherPitchByTransposeFactor(factor: number): Pitch
  • getLowerPitchByTransposeFactor(factor: number): Pitch
  • getTransposedPitch(factor: number): Pitch
  • CalculateTransposedHalfTone(pitch: Pitch, transpose: number): { halftone: number; overflow: number }
  • Parameters

    • pitch: Pitch
    • transpose: number

    Returns { halftone: number; overflow: number }

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

    • halftone: number
    • overflow: number
  • WrapAroundCheck(value: number, limit: number): { halftone: number; overflow: 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 }

    • halftone: number
    • overflow: number
  • 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

  • calcFractionalKey(frequency: number): number
  • calcFrequency(obj: number | Pitch): number
  • fromFrequency(frequency: number): Pitch
  • fromHalftone(halftone: number): Pitch
  • getNoteEnumString(note: NoteEnum): string
  • 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]

Generated using TypeDoc