From 5f1308c20d09eb5385f746e7ee05932ae079b5a6 Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Sun, 11 Sep 2011 18:02:38 +0200 Subject: [PATCH] pitch.cc: let rounded_{semi,quarter}tone_pitch return actually rounded values, towards -inf rather than 0. Adresses issue 1741. --- lily/pitch.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 -- 2.39.5