]> git.donarmstrong.com Git - lilypond.git/commitdiff
lily/stem-engraver.cc: allow distinguishable durations to be stemmed together (string...
authorDavid Kastrup <dak@gnu.org>
Wed, 12 Jan 2011 12:07:42 +0000 (13:07 +0100)
committerDavid Kastrup <dak@gnu.org>
Mon, 18 Jul 2011 07:14:02 +0000 (09:14 +0200)
lily/stem-engraver.cc

index e21d796765ccd1cc1de4daf188b18be068e82d48..fb545911478bab563907bd80b307cd30811bd02f 100644 (file)
@@ -135,8 +135,22 @@ Stem_engraver::acknowledge_rhythmic_head (Grob_info gi)
     make_stem (gi);
 
   int ds = Stem::duration_log (stem_);
-
-  if (ds != d->duration_log ())
+  int dc = d->duration_log ();
+
+  // half notes and quarter notes all have compatible stems.
+  // Longas are done differently (oops?), so we can't unify
+  // them with the other stemmed notes.
+  if (ds == 1)
+    ds = 2;
+  if (dc == 1)
+    dc = 2;
+  // whole notes and brevis both have no stems
+  if (ds == -1)
+    ds = 0;
+  if (dc == -1)
+    dc = 0;
+
+  if (ds != dc) 
     {
       gi.event_cause ()->origin ()->warning (_f ("adding note head to incompatible stem (type = %d/%d)",
                                                 ds < 0 ? 1 << -ds : 1,