From 8a42d3e426528112a0ceacb72e835d70d19f62b2 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Tue, 17 Feb 2004 11:06:56 +0000 Subject: [PATCH] * lily/note-collision.cc (check_meshing_chords): only wipe heads if necessary. Else, simply wipe dots. * input/test/beam-alternate.ly: new file * input/test/piano-staff-distance.ly: new file. --- ChangeLog | 5 ++++ VERSION | 2 +- input/test/beam-alternate.ly | 33 +++++++++++++++++++++ input/test/piano-staff-distance.ly | 5 ++-- lily/note-collision.cc | 46 +++++++++++++++++++++++------- 5 files changed, 76 insertions(+), 15 deletions(-) create mode 100644 input/test/beam-alternate.ly diff --git a/ChangeLog b/ChangeLog index aadd667f3d..cfbd1bdf8a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2004-02-17 Han-Wen Nienhuys + * lily/note-collision.cc (check_meshing_chords): only wipe heads + if necessary. Else, simply wipe dots. + + * input/test/beam-alternate.ly: new file + * input/test/piano-staff-distance.ly: new file. * lily/translator-group.cc (recurse_down_translators): use diff --git a/VERSION b/VERSION index 23e535e786..e8dd6499cc 100644 --- a/VERSION +++ b/VERSION @@ -2,5 +2,5 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=2 MINOR_VERSION=1 PATCH_LEVEL=24 -MY_PATCH_LEVEL= +MY_PATCH_LEVEL=hwn1 diff --git a/input/test/beam-alternate.ly b/input/test/beam-alternate.ly new file mode 100644 index 0000000000..dd49951014 --- /dev/null +++ b/input/test/beam-alternate.ly @@ -0,0 +1,33 @@ + +\header { + + texidoc = "Meshing eighths beams, connected by ties. This occurs + in (for example) in the cello suites. See also + @file{tie-cross-voice.ly}." + +} + +wipeNote = { + \once \override NoteHead #'transparent = ##t + \once \override Stem #'transparent = ##t +} + + +\score { + \notes \relative c'' { + << { + c8[~ + \wipeNote + c8 + c8~ + \wipeNote + c~ + c] + }\\ + { s8 c8 [ s c s c] } + + + >> + } + \paper { raggedright = ##t } +} diff --git a/input/test/piano-staff-distance.ly b/input/test/piano-staff-distance.ly index 556d68ccc8..e0d6e5b3cb 100644 --- a/input/test/piano-staff-distance.ly +++ b/input/test/piano-staff-distance.ly @@ -3,9 +3,8 @@ { texidoc = "It is possible to have different staff distances across -piano systems, but it requires some advanced magic. Kids don't try this at home. - -" +piano systems, but it requires some advanced magic. Kids don't try +this at home. " } diff --git a/lily/note-collision.cc b/lily/note-collision.cc index 0f51668c8a..db71ddf296 100644 --- a/lily/note-collision.cc +++ b/lily/note-collision.cc @@ -187,27 +187,51 @@ check_meshing_chords (Grob *me, { shift_amount = 0; - /* Wipe shortest head, or head with smallest amount of dots. - Note: when merging different heads, dots on shortest - disappear. */ - - Grob *wipe_ball = nu; + + /* If possible, don't wipe any heads. Else, wipe shortest head, + or head with smallest amount of dots. Note: when merging + different heads, dots on the smaller one disappear. */ + Grob *wipe_ball = 0; + Grob *dot_wipe_head = nu; if (upball_type == dnball_type) { if (Rhythmic_head::dot_count (nd) < Rhythmic_head::dot_count (nu)) - wipe_ball = nd; + { + wipe_ball = nd; + dot_wipe_head = nd; + } + else if (Rhythmic_head::dot_count (nd) > Rhythmic_head::dot_count (nu)) + { + dot_wipe_head = nu; + wipe_ball = nu; + } + else + { + dot_wipe_head = nu; + } } else if (dnball_type > upball_type) - wipe_ball = nd; + { + wipe_ball = nd; + dot_wipe_head = nd; + } + else if (dnball_type < upball_type) + { + wipe_ball = nu; + dot_wipe_head = nu; + } - if (wipe_ball->live ()) + if (dot_wipe_head) + { + if (Grob *d = unsmob_grob (dot_wipe_head->get_grob_property ("dot"))) + d->suicide (); + } + + if (wipe_ball && wipe_ball->live ()) { wipe_ball->set_grob_property ("transparent", SCM_BOOL_T); wipe_ball->set_grob_property ("stencil", SCM_EOL); - - if (Grob *d = unsmob_grob (wipe_ball->get_grob_property ("dot"))) - d->suicide (); } } /* TODO: these numbers are magic; should devise a set of grob props -- 2.39.5