2007/10/10, Rune Zedeler <[EMAIL PROTECTED]>: > void > Pitch::transpose (Pitch delta) > { > Rational new_alter = tone_pitch () + delta.tone_pitch (); > > octave_ += delta.octave_; > notename_ += delta.notename_; > alteration_ += new_alter - tone_pitch (); > > normalize (); > } > > This looks very ineffecient. > > Rational new_alter = tone_pitch () + delta.tone_pitch (); > alteration_ += new_alter - tone_pitch (); > > is equivalent to > > alteration_ += delta.tone_pitch ();
No it's not. tone_pitch() changes in between since notename_ is changed. Think about: a major third on B is D#, so alteration is changed by an amount that is is not equal to the alteration of E-natural. -- Han-Wen Nienhuys - [EMAIL PROTECTED] - http://www.xs4all.nl/~hanwen _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel