]> git.donarmstrong.com Git - lilypond.git/commitdiff
Merge commit '2a2f4f5'
authorJoe Neeman <joeneeman@gmail.com>
Sat, 18 Aug 2007 10:11:04 +0000 (20:11 +1000)
committerJoe Neeman <joeneeman@gmail.com>
Sat, 18 Aug 2007 10:11:04 +0000 (20:11 +1000)
Documentation/user/advanced-notation.itely
input/regression/slur-cross-staff-beam.ly [new file with mode: 0644]
lily/note-spacing.cc
lily/paper-column-engraver.cc
lily/paper-column.cc
lily/slur.cc
lily/spacing-determine-loose-columns.cc
lily/spacing-interface.cc

index 69beebf8204fba524fa967f6145cf83fcc1c0739..428a793359a6ea6b36274293982f26c812fa2a5a 100644 (file)
@@ -371,6 +371,11 @@ bar lines,
 }
 @end lilypond
 
+Possible symbols for the @code{break-align-symbols} list are
+@code{ambitus}, @code{breathing-sign}, @code{clef}, @code{custos},
+@code{staff-bar}, @code{left-edge}, @code{key-cancellation},
+@code{key-signature}, and @code{time-signature}.
+
 The text marks will, by default, be aligned with the middle of the notation
 object, but this can be changed by overriding the
 @code{break-align-anchor-alignment} and
@@ -392,9 +397,10 @@ object, but this can be changed by overriding the
   \once \override Staff.KeySignature #'break-align-anchor-alignment = #RIGHT
   \mark \default
   ces1
+  \key cis \major
 
-  % the RehearsalMark will be aligned with the right edge of the KeySignature
-  % and then shifted right by an additional 2 units.
+  % the RehearsalMark will be aligned with the left edge of the KeySignature
+  % and then shifted right by 2 units.
   \once \override Staff.KeySignature #'break-align-anchor = #2
   \mark \default
   ces1
@@ -1085,30 +1091,7 @@ c1
 See @ref{The Feta font}, for a list of symbols which may be
 printed with @code{\musicglyph}.
 
-The horizontal location of rehearsal marks can be adjusted by
-setting @code{break-align-symbol}
-
-@lilypond[fragment,quote,ragged-right,verbatim,relative]
-c1
-\key cis \major
-\clef alto
-\override Score.RehearsalMark #'break-align-symbols = #'(key-signature)
-\mark "on-key"
-cis
-\key ces \major
-\override Score.RehearsalMark #'break-align-symbols = #'(clef)
-\clef treble
-\mark "on clef"
-ces
-@end lilypond
-
-@code{break-align-symbol} may also accept the following values:
-@code{ambitus}, @code{breathing-sign}, @code{clef}, @code{custos},
-@code{staff-bar}, @code{left-edge}, @code{key-cancellation},
-@code{key-signature}, and @code{time-signature}.  Setting
-@code{break-align-symbol} will only have an effect if the symbol
-appears at that point in the music.
-
+For common tweaks to the positioning of rehearsal marks, see @ref{Text marks}.
 
 @seealso
 
diff --git a/input/regression/slur-cross-staff-beam.ly b/input/regression/slur-cross-staff-beam.ly
new file mode 100644 (file)
index 0000000..ea9d13d
--- /dev/null
@@ -0,0 +1,13 @@
+\version "2.11.29"
+
+\header {
+  texidoc = "Slurs that depend on a cross-staff beam are not calculated until after line-breaking."
+}
+
+\paper{ ragged-right=##t }
+\score {
+    \new PianoStaff <<
+    \context Staff = rh \relative { c'8([ d) \change Staff = lh c,] }
+    \context Staff = lh { s4. }
+    >>
+}
\ No newline at end of file
index d476f70fa08c617b835ee5181be228db13c9eb84..93be9228e2f90ff06a5ec84eee17e2aa4509c471 100644 (file)
@@ -81,13 +81,19 @@ Note_spacing::get_spacing (Grob *me, Item *right_col,
                                                      Bar_line::has_interface);
 
       if (bar)
-       ideal -= bar->extent (right_col, X_AXIS)[LEFT];
+       {
+         Real shift = bar->extent (right_col, X_AXIS)[LEFT];
+         ideal -= shift;
+         min_desired_space -= max (shift, 0.0);
+       }
+      else
+       ideal -= right_col->extent (right_col, X_AXIS)[RIGHT];
     }
 
   ideal = max (ideal, min_desired_space);
   stem_dir_correction (me, right_col, increment, &ideal, &min_desired_space);
 
-  Spring ret (ideal, min_dist);
+  Spring ret (max (0.0, ideal), min_dist);
   ret.set_inverse_compress_strength (max (0.0, ideal - min_desired_space));
   ret.set_inverse_stretch_strength (max (0.1, base_space - increment));
   return ret;
index 1396c1280d94f8815e0ce6ba32f5ee26fd41bd52..481ffd14645b049bb523a3d04d02b99f08282791 100644 (file)
@@ -10,6 +10,7 @@
 #include "system.hh"
 #include "international.hh"
 #include "accidental-placement.hh"
+#include "accidental-interface.hh"
 #include "axis-group-interface.hh"
 #include "context.hh"
 #include "note-spacing.hh"
@@ -196,14 +197,14 @@ Paper_column_engraver::stop_translation_timestep ()
       Item *elem = items_[i];
       Grob *col = Item::is_non_musical (elem) ? command_column_ : musical_column_;
 
-      if (!elem->get_parent (X_AXIS)
-         || !unsmob_grob (elem->get_object ("axis-group-parent-X")))
-       {
-         Axis_group_interface::add_element (col, elem);
-       }
-      else if (Accidental_placement::has_interface (elem))
+      if (!elem->get_parent (X_AXIS))
+       elem->set_parent (col, X_AXIS);
+      if (!unsmob_grob (elem->get_object ("axis-group-parent-X")))
+       elem->set_object ("axis-group-parent-X", col->self_scm ());
+
+      if (Accidental_placement::has_interface (elem))
        Separation_item::add_conditional_item (col, elem);
-      else
+      else if (!Accidental_interface::has_interface (elem))
        Separation_item::add_item (col, elem);
     }
   items_.clear ();
index bb827db18b72fe183cc0d7b9a59ea706710f572a..53dfd4a906a2b907baeb59ced8b2ae998bcd3a7e 100644 (file)
@@ -152,6 +152,8 @@ Paper_column::minimum_distance (Grob *left, Grob *right)
     }
   while (flip (&d) != LEFT);
 
+  skys[RIGHT].merge (Separation_item::conditional_skyline (right, left));
+
   return max (0.0, skys[LEFT].distance (skys[RIGHT]));
 }
 
index 22535ef7658c2c9ef8f8d65a96ff4c289ac4d6cd..c37aa72ad9b53a98cd6e395fa9e8b0da5e8ade96 100644 (file)
@@ -14,6 +14,7 @@
 #include "bezier.hh"
 #include "directional-element-interface.hh"
 #include "font-interface.hh"
+#include "item.hh"
 #include "pointer-group-interface.hh"
 #include "lookup.hh"
 #include "main.hh"             // DEBUG_SLUR_SCORING
@@ -368,6 +369,13 @@ Slur::calc_cross_staff (SCM smob)
   extract_grob_set (me, "note-columns", cols);
   extract_grob_set (me, "encompass-objects", extras);
 
+  for (vsize i = 0; i < cols.size (); i++)
+    {
+      if (Grob *s = Note_column::get_stem (cols[i]))
+       if (to_boolean (s->get_property ("cross-staff")))
+         return SCM_BOOL_T;
+    }
+
   /* the separation items are dealt with in replace_breakable_encompass_objects
      so we can ignore them here */
   vector<Grob*> non_sep_extras;
index 5b13c82264362ded0f7f8717ee82bae0b77e824f..fe072bca0aba3a93097095595e49101faaded388 100644 (file)
@@ -157,7 +157,7 @@ Spacing_spanner::set_distances_for_loose_col (Grob *me, Grob *c,
              Real base = note_spacing (me, lc, rc, options);
              Spring spring = Note_spacing::get_spacing (sp, rc, base, options->increment_);
 
-             dists[d] = max (dists[d], spring.distance () - options->increment_);
+             dists[d] = max (dists[d], spring.min_distance ());
            }
          else if (Staff_spacing::has_interface (sp))
            {
index 1cf1a02cdc941a30a54e2c0e7cfab31aac668484..65ac96834fe505e668cd7bfea1a7c5823fbb89dc 100644 (file)
@@ -96,6 +96,15 @@ Spacing_interface::minimum_distance (Grob *me, Grob *right)
   this will add a new column to RIGHT-ITEMS. Here we look at the
   columns, and return the left-most. If there are multiple columns, we
   prune RIGHT-ITEMS.
+
+  If we end up pruning, we add a left-neighbor to every column that
+  gets pruned. This ensures that loose columns in cross-staff music
+  do indeed get marked as loose. The problem situation is when a voice
+  passes from staff 1 to staff 2 and a clef appears later on in staff 1.
+  Then the NoteSpacing attached to the last note in staff 1 has two
+  right-items: one pointing to the next note in staff 2 and one pointing
+  to the clef. We will prune the clef right-item here and, unless we add
+  a left-neighbor to the clef, it won't get marked as loose.
 */
 Item *
 Spacing_interface::right_column (Grob *me)
@@ -122,6 +131,8 @@ Spacing_interface::right_column (Grob *me)
 
          mincol = col;
        }
+      else if (rank > min_rank)
+       prune = true;
     }
 
   if (prune && a)
@@ -130,7 +141,15 @@ Spacing_interface::right_column (Grob *me)
       for (vsize i = right.size (); i--;)
        {
          if (dynamic_cast<Item *> (right[i])->get_column () != mincol)
-           right.erase (right.begin () + i);
+           {
+             extract_grob_set (right[i], "left-neighbors", lns);
+             if (lns.empty ())
+               Pointer_group_interface::add_grob (right[i],
+                                                  ly_symbol2scm ("left-neighbors"),
+                                                  dynamic_cast<Item*> (me)->get_column ());
+
+             right.erase (right.begin () + i);
+           }
        }
     }