Chroma
The Chroma class contains some static helper methods for extracting information from “chroma”, the signed distance of a Pitch from C or an interval from the unison in perfect 5ths.
Methods
Section titled “Methods”toLetter
Section titled “toLetter”static toLetter(chroma: number): string;
Returns the letter component of the pitch class name represented by a given Pitch chroma.
toAccidental
Section titled “toAccidental”static toAccidental(chroma: number): number;
Returns the accidental component of the pitch class name represented by a given Pitch chroma.
- 0 is natural.
- +1 / -1 is sharp/flat.
- +2 / -2 is double sharp/double flat. etc. for arbitrarily remote accidentals.