when a note is transposed, its .Pitch is still the untransposed one. Calculating the transposed pitch is quite difficult for developers, so this is helpful information. discussed on Discord
@@ -2491,6 +2491,7 @@ export abstract class MusicSheetCalculator {
pitch = graphicalNote.Transpose(
accidentalCalculator.ActiveKeyInstruction, activeClef, transposeHalftones, octaveEnum
);
+ graphicalNote.sourceNote.TransposedPitch = pitch;
}
graphicalNote.sourceNote.halfTone = pitch.getHalfTone();
accidentalCalculator.checkAccidental(graphicalNote, pitch);
@@ -57,6 +57,8 @@ export class Note {
* The untransposed (!!!) source data.
*/
private pitch: Pitch;
+ /** The transposed pitch, if the score is transposed, otherwise undefined. */
+ public TransposedPitch: Pitch;
public displayStepUnpitched: NoteEnum;
public displayOctaveUnpitched: number;
public get NoteAsString(): string {