From 8cf033e6cb404c31512b15b6d73fece0629fb67d Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Sat, 6 Sep 2014 00:07:59 +0200 Subject: [PATCH] Issue 346: monochord issues 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 | 16 ++++++++++++++++ lily/stem.cc | 28 +++++++++++++++++++++++----- 2 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 input/regression/monochords.ly diff --git a/input/regression/monochords.ly b/input/regression/monochords.ly new file mode 100644 index 0000000000..7dfd994863 --- /dev/null +++ b/input/regression/monochords.ly @@ -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 + \longa \breve 1 2 4 8 8 \break + \longa \breve 1 2 4 8 8 +} + +\paper { + ragged-right = ##t +} diff --git a/lily/stem.cc b/lily/stem.cc index a809c170df..b5d9f829ac 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -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: -- 2.39.5