Skip to main content

alphaTab.model.SpelledPitch

A pitch as it is written in notation: a diatonic step with an accidental in an octave. Enharmonic spellings like F#3 and Gb3 share the same value but are distinct pitches. Pitches are immutable, in JSON they are written as text like F#3.

 class SpelledPitch

Propertiesโ€‹

alterโ€‹

The accidental of the pitch in semitones: -2 = double flat, -1 = flat, 0 = natural, 1 = sharp, 2 = double sharp.

readonly alter: number;

chromaโ€‹

The pitch class of the pitch in the range 0-11 (C = 0, C#/Db = 1 ... B = 11).

readonly chroma: number;

octaveโ€‹

The octave of the written step in scientific pitch notation (C4 is the middle C). The accidental does not change the octave: B#3 sounds like C4 and Cb4 sounds like B3.

readonly octave: number;

stepโ€‹

The diatonic step (letter) of the pitch: 0 = C, 1 = D, 2 = E, 3 = F, 4 = G, 5 = A, 6 = B.

readonly step: number;

valueโ€‹

The MIDI value of the pitch (C4 = 60).

readonly value: number;

Methodsโ€‹

toNameStringโ€‹

The written name of the pitch without octave, like C, F# or Bbb.

toNameString(): string

toStringโ€‹

The written name of the pitch with octave, like C4, F#3 or Bbb2.

toString(): string