From: David Kastrup Date: Sun, 11 Sep 2011 16:02:38 +0000 (+0200) Subject: pitch.cc: let rounded_{semi,quarter}tone_pitch return actually rounded values, toward... X-Git-Tag: release/2.15.12-1~64 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=5f1308c20d09eb5385f746e7ee05932ae079b5a6;p=lilypond.git pitch.cc: let rounded_{semi,quarter}tone_pitch return actually rounded values, towards -inf rather than 0. Adresses issue 1741. --- diff --git a/lily/pitch.cc b/lily/pitch.cc index 97664e6530..facbf5d05d 100644 --- a/lily/pitch.cc +++ b/lily/pitch.cc @@ -25,6 +25,7 @@ #include "warn.hh" #include "ly-smobs.icc" +#include Pitch::Pitch (int o, int n, Rational a) { @@ -78,13 +79,13 @@ Pitch::tone_pitch () const int Pitch::rounded_semitone_pitch () const { - return int (double (tone_pitch () * Rational (2))); + return int (floor (double (tone_pitch () * Rational (2) + Rational (1,2)))); } int Pitch::rounded_quartertone_pitch () const { - return int (double (tone_pitch () * Rational (4))); + return int (floor (double (tone_pitch () * Rational (4) + Rational (1,2)))); } void