]> git.donarmstrong.com Git - lilypond.git/commitdiff
Merge branch 'release/unstable' into HEAD
authorGraham Percival <graham@percival-music.ca>
Mon, 19 Mar 2012 11:50:31 +0000 (11:50 +0000)
committerGraham Percival <graham@percival-music.ca>
Mon, 19 Mar 2012 11:50:31 +0000 (11:50 +0000)
VERSION
input/regression/beam-shortened-lengths.ly
input/regression/collision-seconds.ly
lily/include/stem.hh
lily/note-collision.cc
lily/stem.cc

diff --git a/VERSION b/VERSION
index 84d4cc3a272a72bc81f114e7a6859ae2f37d3c82..5644dcd169f43af477b8ce556cdca89972319e20 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,7 +1,7 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=2
 MINOR_VERSION=15
-PATCH_LEVEL=34
+PATCH_LEVEL=35
 MY_PATCH_LEVEL=
 VERSION_STABLE=2.14.2
-VERSION_DEVEL=2.15.33
+VERSION_DEVEL=2.15.34
index a79917d3231f6a11460085c498dc19e8269b4ec7..24cee7905fb04763768743d763d621af84c40c99 100644 (file)
@@ -1,4 +1,3 @@
-
 \version "2.14.0"
 
 \header{
@@ -8,8 +7,6 @@
 
 
 \relative c'{
-  \override Beam #'skip-quanting = ##t
   \stemUp
   f'4  f8[ f]  f16[ f]  f32[ f]  f64[ f]  f128[ f] 
 }
-
index 70b0e052e046330b18097dd294d8f0ae4bb2a075..ea9a72735508fc9bf701ee0c52af4fa71e8844b3 100644 (file)
@@ -1,10 +1,16 @@
-\version "2.14.0"
+\version "2.13.34"
 
 \header {
-  texidoc = "Seconds do not confuse the collision algorithm too much. The best
-way to format this would be to merge the two Ds, but we will be happy for now
-if the upstem D does not collide with the downstem C."
+  texidoc = "Seconds do not confuse the collision algorithm.
+The first pair of chords in each measure should merge, mesh,
+or come relatively close, but the second in each measure needs
+more space to make clear which notes belong to which voice."
 }
 
-
-<< d' \\ <c' d'> >>
+\relative f << {
+  <a' b>2 <a b d e> <a e' f> <a e' f> <a b c> <f g a>
+  \bar "||" <f g c> <g a c> <f g c d> <f g c d>
+} \\ {
+  <g a> <a b> <g a e'> <g a c e> <f g a> <a b c>
+  <g a e'> <g a e'> <g c d> <g a b>
+} >>
index b1c1324ea82f1a80313f626ff56a5c39b616f0b9..de1b7d6c9a7b3ee8047737cddb8cdb2e06ff580b 100644 (file)
@@ -28,7 +28,7 @@
 class Stem
 {
 public:
-  static vector<int> note_head_positions (Grob *);
+  static vector<int> note_head_positions (Grob *, bool filter = false);
   static int duration_log (Grob *);
   static void set_beaming (Grob *, int, Direction d);
   static int get_beaming (Grob *, Direction d);
index 3d14a3649bef67db281fdf53475171e59561aa5f..6a2abb671467febbd81a4aafa88ec5765e859ac6 100644 (file)
@@ -56,13 +56,35 @@ check_meshing_chords (Grob *me,
   Grob *head_up = Note_column::first_head (clash_up);
   Grob *head_down = Note_column::first_head (clash_down);
 
-  vector<int> ups = Stem::note_head_positions (Note_column::get_stem (clash_up));
-  vector<int> dps = Stem::note_head_positions (Note_column::get_stem (clash_down));
+  /* Staff-positions of all noteheads on each stem */
+  vector<int> ups = Stem::note_head_positions (stems[UP]);
+  vector<int> dps = Stem::note_head_positions (stems[DOWN]);
 
   /* Too far apart to collide. */
   if (ups[0] > dps.back () + 1)
     return;
 
+  /* If the chords just 'touch' their extreme noteheads,
+     then we can align their stems.
+  */
+  bool touch = false;
+  if (ups[0] >= dps.back ()
+      && (dps.size () < 2 || ups[0] >= dps[dps.size () - 2] + 2)
+      && (ups.size () < 2 || ups[1] >= dps.back () + 2))
+    touch = true;
+
+  /* Filter out the 'o's in this configuration, since they're no
+   * part in the collision.
+   *
+   *  |
+   * x|o
+   * x|o
+   * x
+   *
+   */
+  ups = Stem::note_head_positions (stems[UP], true);
+  dps = Stem::note_head_positions (stems[DOWN], true);
+
   /* Merge heads if the notes lie the same line, or if the "stem-up-note" is
      above the "stem-down-note". */
   bool merge_possible = (ups[0] >= dps[0]) && (ups.back () >= dps.back ());
@@ -118,16 +140,6 @@ check_meshing_chords (Grob *me,
    *
    */
 
-  /* TODO: filter out the 'o's in this configuration, since they're no
-   * part in the collision.
-   *
-   *  |
-   * x|o
-   * x|o
-   * x
-   *
-   */
-
   bool close_half_collide = false;
   bool distant_half_collide = false;
   bool full_collide = false;
@@ -163,16 +175,6 @@ check_meshing_chords (Grob *me,
   full_collide = full_collide || (close_half_collide
                                   && distant_half_collide);
 
-  /* If the only collision is in the extreme noteheads,
-     then their stems can line up and the chords just 'touch'.
-     A half collision with the next note along the chord prevents touching.
-  */
-  bool touch = false;
-  if (ups[0] >= dps.back ()
-      && (dps.size () < 2 || ups[0] >= dps[dps.size () - 2] + 2)
-      && (ups.size () < 2 || ups[1] >= dps.back () + 2))
-    touch = true;
-
   /* Determine which chord goes on the left, and which goes right.
      Up-stem usually goes on the right, but if chords just 'touch' we can put
      both stems on a common vertical line.  In the presense of collisions,
@@ -525,12 +527,12 @@ Note_collision_interface::automatic_shift (Grob *me,
   while ((flip (&d)) != UP);
 
   /*
-    do horizontal shifts of each direction
-
-    |
-    x||
-    x||
-    x|
+   * do horizontal shifts of each direction
+   *
+    |
+   * x||
+    x||
+   *   x|
   */
 
   do
index 8c0e128487b4f48027bb7f23e8810b19aa229c56..f662f3cf1dec75637680e3c85f9bcd9fd31a158c 100644 (file)
@@ -236,18 +236,23 @@ Stem::extremal_heads (Grob *me)
   return exthead;
 }
 
-/* The positions, in ascending order.  */
+/* The staff positions, in ascending order.
+ * If FILTER, include the main column of noteheads only */
 vector<int>
-Stem::note_head_positions (Grob *me)
+Stem::note_head_positions (Grob *me, bool filter)
 {
   vector<int> ps;
   extract_grob_set (me, "note-heads", heads);
+  Grob *xref = common_refpoint_of_array (heads, me, X_AXIS);
 
   for (vsize i = heads.size (); i--;)
     {
       Grob *n = heads[i];
-      int p = Staff_symbol_referencer::get_rounded_position (n);
+      if (filter
+          && n->relative_coordinate (xref, X_AXIS) != 0.0)
+        continue;
 
+      int p = Staff_symbol_referencer::get_rounded_position (n);
       ps.push_back (p);
     }