semitones property

int get semitones

Total semitone offset from written to sounding pitch.

MusicXML says a doubled part sounds in BOTH octaves; a single-voice MIDI rendering has to pick one, and this picks the doubling octave, matching what notation programs do when they collapse a doubled part to one line.

Implementation

int get semitones =>
    chromatic +
    (octaveChange * 12) +
    (doubled ? (doubledAbove ? 12 : -12) : 0);