]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 346: monochord issues
authorDavid Kastrup <dak@gnu.org>
Fri, 5 Sep 2014 22:07:59 +0000 (00:07 +0200)
committerDavid Kastrup <dak@gnu.org>
Sun, 14 Sep 2014 05:43:43 +0000 (07:43 +0200)
This lets a reverse notehead at the stem start creep up closer to its
same-pitch unreversed partner in order to avoid a gap caused by notehead
slant.

input/regression/monochords.ly [new file with mode: 0644]
lily/stem.cc

diff --git a/input/regression/monochords.ly b/input/regression/monochords.ly
new file mode 100644 (file)
index 0000000..7dfd994
--- /dev/null
@@ -0,0 +1,16 @@
+\version "2.19.14"
+
+\header { texidoc = "
+Whole notes in a monochord must be properly offset so that the heads just
+touch each other.  On the other hand, a stem should touch both notes.
+" }
+
+\relative c'' {
+  \time 4/1
+  <a a>\longa \breve 1 2 4 8 8 \break
+  <c c>\longa \breve 1 2 4 8 8
+}
+
+\paper {
+  ragged-right = ##t
+}
index a809c170df7a70e7716a5b1d971c87cd9f889f2e..b5d9f829acef0fb698e5fcafe003381bfe7328d4 100644 (file)
@@ -575,14 +575,32 @@ Stem::calc_positioning_done (SCM smob)
                 stem 100% whereas reversed heads only overlaps the
                 stem 50%
               */
-
               Real reverse_overlap = 0.5;
-              heads[i]->translate_axis ((ell - thick * reverse_overlap) * d,
-                                        X_AXIS);
+
+              /*
+                However, the first reverse head has to be shifted even
+                more than the full reverse overlap if it is the same
+                height as the first head or there will be a gap
+                because of the head slant (issue 346).
+              */
+
+              if (i == 1 && dy < 0.1)
+                reverse_overlap = 1.1;
 
               if (is_invisible (me))
-                heads[i]->translate_axis (-thick * (2 - reverse_overlap) * d,
-                                          X_AXIS);
+                {
+                  // Semibreves and longer are tucked in considerably
+                  // to be recognizable as chorded rather than
+                  // parallel voices.  During the course of issue 346
+                  // there was a discussion to change this for unisons
+                  // (dy < 0.1) to reduce overlap but without reaching
+                  // agreement and with Gould being rather on the
+                  // overlapping front.
+                  reverse_overlap = 2;
+                }
+
+              heads[i]->translate_axis ((ell - thick * reverse_overlap) * d,
+                                        X_AXIS);
 
               /* TODO: