Transpose a note by a signed number of semitones, keeping its spelling.
The letter moves by the diatonic distance of the conventional interval for
that many semitones and the accidental is recomputed for the new letter, so
enharmonic identity survives: Ab4 up a major second is Bb4, not A#4, and
the operation is an exact inverse of itself. An octave-less note stays
octave-less.
A bare semitone count cannot distinguish an augmented fourth from a diminished
fifth; pass spelling to override the letter distance when the enharmonic
choice matters.
Transpose a note by a signed number of semitones, keeping its spelling.
The letter moves by the diatonic distance of the conventional interval for that many semitones and the accidental is recomputed for the new letter, so enharmonic identity survives:
Ab4up a major second isBb4, notA#4, and the operation is an exact inverse of itself. An octave-less note stays octave-less.A bare semitone count cannot distinguish an augmented fourth from a diminished fifth; pass
spellingto override the letter distance when the enharmonic choice matters.