]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/note-collision.cc (check_meshing_chords): only wipe heads
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 17 Feb 2004 11:06:56 +0000 (11:06 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 17 Feb 2004 11:06:56 +0000 (11:06 +0000)
if necessary. Else, simply wipe dots.

* input/test/beam-alternate.ly: new file

* input/test/piano-staff-distance.ly: new file.

ChangeLog
VERSION
input/test/beam-alternate.ly [new file with mode: 0644]
input/test/piano-staff-distance.ly
lily/note-collision.cc

index aadd667f3d23b942491dff223c77df167bb042c3..cfbd1bdf8afea5be41b17dfa23f26aa4aad54004 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2004-02-17  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * 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 23e535e786469bd387101bb2cf59d77e7ba47698..e8dd6499cc1aaed649fffc170f9966153c27d26d 100644 (file)
--- 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 (file)
index 0000000..dd49951
--- /dev/null
@@ -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 }
+}
index 556d68ccc8fd387f6ff79f5dc267ae4a5a19a613..e0d6e5b3cbb14167f9d97a748700a9c25368c455 100644 (file)
@@ -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.  "
 
 }
 
index 0f51668c8a1e38ad0274b690873c96db49478944..db71ddf2969ce1dfcb22b0cc949d84620d60de32 100644 (file)
@@ -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