The note rendered as scientific pitch notation, e.g. 'G4' or 'Bb'.
The pitch class (0..11), ignoring octave.
The diatonic letter number: 0..6 for C..B.
The chromatic alteration in semitones: -1 flat, 0 natural, +1 sharp, ...
The octave (scientific pitch notation), or undefined for a bare pitch class.
A copy of the underlying plain note object.
StaticofParse scientific pitch notation (e.g. 'C#4', 'Bb', 'F##3').
The note text.
The parsed note.
StaticfromName a MIDI number (middle C = C4 = 60) as a note.
The MIDI number.
Whether to prefer sharps or flats for black keys.
The spelled note, with octave.
StaticfromTranspose by a signed number of semitones.
When the note carries an octave the transposition happens in MIDI space and the result is spelled with a sharp preference. An octave-less note stays octave-less: only its pitch class is moved. Transposing by zero is the identity: the original spelling is preserved (no enharmonic respelling).
The signed semitone offset.
The transposed note.
The spelled interval from this note to another.
The second note.
The diatonic number, quality, and semitone span.
Whether another note has the same letter, alteration, and octave.
The note to compare.
True if the spellings are identical.
The plain note data, for JSON serialization.
Private class fields do not serialize, so an explicit toJSON keeps
JSON.stringify(note) from collapsing to {}.
A copy of the underlying plain note object.
An immutable spelled note: a diatonic letter plus a chromatic alteration and an optional octave. Wraps the plain note object and delegates to the pitch module; every transformation returns a new instance.
Example