From 3cfbe76597441ea915603c4e6e60d3e660fce647 Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Wed, 12 Jan 2011 13:08:44 +0100 Subject: [PATCH] lily/stem-engraver.cc: Improve error message for incompatible durations while stemming --- input/regression/incompatible-stem-warning.ly | 22 +++++++++++++++++++ lily/stem-engraver.cc | 10 +++++---- 2 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 input/regression/incompatible-stem-warning.ly diff --git a/input/regression/incompatible-stem-warning.ly b/input/regression/incompatible-stem-warning.ly new file mode 100644 index 0000000000..95dc1c1d2c --- /dev/null +++ b/input/regression/incompatible-stem-warning.ly @@ -0,0 +1,22 @@ +\version "2.13.59" + +\header { + + texidoc = " +Combine several kinds of stems in parallel voices. +" + +} + +\new Voice { \time 4/1 + << c'\breve e'8 >> + << c'8 e'\breve >> | + << c'\longa e'1 >> | + << c'1 e'\longa >> | + << c'2 e'1 >> + << c'1 e'2 >> + << c'2 e'4 >> + << c'4 e'2 >> + << c'2 e'8 >> + << c'8 e'2 >> +} diff --git a/lily/stem-engraver.cc b/lily/stem-engraver.cc index 137040766a..e21d796765 100644 --- a/lily/stem-engraver.cc +++ b/lily/stem-engraver.cc @@ -134,11 +134,13 @@ Stem_engraver::acknowledge_rhythmic_head (Grob_info gi) if (!stem_) make_stem (gi); - if (Stem::duration_log (stem_) != d->duration_log ()) + int ds = Stem::duration_log (stem_); + + if (ds != d->duration_log ()) { - // FIXME: - gi.event_cause ()->origin ()->warning (_f ("adding note head to incompatible stem (type = %d)", - 1 << Stem::duration_log (stem_))); + gi.event_cause ()->origin ()->warning (_f ("adding note head to incompatible stem (type = %d/%d)", + ds < 0 ? 1 << -ds : 1, + ds > 0 ? 1 << ds : 1)); gi.event_cause ()->origin ()->warning (_ ("maybe input should specify polyphonic voices")); } -- 2.39.5