]> git.donarmstrong.com Git - lilypond.git/commitdiff
Merge branch 'master' of ssh+git://hanwen@git.sv.gnu.org/srv/git/lilypond
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 7 Feb 2007 19:32:07 +0000 (20:32 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 7 Feb 2007 19:32:07 +0000 (20:32 +0100)
14 files changed:
Documentation/topdocs/NEWS.tely
Documentation/user/running.itely
Documentation/user/tweaks.itely
input/regression/tuplet-bracket-cross-staff.ly [new file with mode: 0644]
lily/constrained-breaking.cc
lily/include/slur.hh
lily/include/stem.hh
lily/include/tuplet-bracket.hh
lily/slur-engraver.cc
lily/slur.cc
lily/stem.cc
lily/tuplet-bracket.cc
lily/tuplet-number.cc
scm/define-grobs.scm

index 1e6e5b7da8afbf3cf33294b688bfe33cfeab23a5..46a24d2db5688012fa13d745768c01746fa2b63c 100644 (file)
@@ -90,7 +90,8 @@ All line spanners are more flexible now in the configuration of their
 end points.  This includes glissando, voice followers, text crescendos
 and other text spanners.
 
-@lilypond[ragged-right]
+@c  with ragged-right we can't see the gliss.
+@lilypond[]
 \relative c'' {
   \override Glissando #'bound-details #'right #'text = \markup { \hcenter \bold down }
   \override Glissando #'bound-details #'right #'Y = #-4
index 5709230bdde7c7e7c906ec2d6874147ccd1ad872..981e71867a5d2fcd8e5c7a418361215b82bf3a57 100644 (file)
@@ -451,6 +451,12 @@ To upgrade LilyPond fragments in texinfo files, use
 convert-ly --from=... --to=... --no-version *.itely
 @end example
 
+To see the changes in the LilyPond syntax between two versions, use
+
+@example
+convert-ly --from=... --to=... -s
+@end example
+
 To upgrade many files at once, combine @code{convert-ly} with
 standard unix commands.  This example will upgrade all @code{.ly}
 files in the current directory
index ad1280ef3a6fc5b145aebfcb9a20fba83746686f..0d48a53ee7a6d3f526ee39fc2e36a5a32008368c 100644 (file)
@@ -39,11 +39,9 @@ TODO: with the new spacing features in 2.12, these specific examples are no
 longer relevant.  However, they still demonstrate powerful features
 of lilypond, so they remain until somebody creates some better examples.
 
-@c % \once \override TextScript #'extra-offset = #'(0 . -2 )
-@c @l ilypond[quote,fragment,ragged-right,verbatim,relative=2]
 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
   % temporary code to break this example:
-  % \once \override TextScript #'extra-offset = #'(0 . -2 )
+  \override TextScript #'outside-staff-priority = ##f
 e4^\markup{ \italic ritenuto } g b e
 @end lilypond
 
@@ -57,6 +55,8 @@ objects, this value is around 1.0 or less (it varies with each
 object). We want to increase it, so let's try 1.5
 
 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
+  % temporary code to break this example:
+  \override TextScript #'outside-staff-priority = ##f
 \once \override TextScript #'padding = #1.5
 e4^\markup{ \italic ritenuto } g b e
 @end lilypond
@@ -75,16 +75,18 @@ object and the staff.  This is a subtle difference, but you can see
 the behavior here.
 
 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
+  % temporary code to break this example:
+  \override TextScript #'outside-staff-priority = ##f
 c4^"piu mosso" b a b
-\once \override TextScript #'padding = #2.6
+\once \override TextScript #'padding = #4.6
 c4^"piu mosso" d e f
-\once \override TextScript #'staff-padding = #2.6
+\once \override TextScript #'staff-padding = #4.6
 c4^"piu mosso" fis a g
 \break
 c'4^"piu mosso" b a b
-\once \override TextScript #'padding = #2.6
+\once \override TextScript #'padding = #4.6
 c4^"piu mosso" d e f
-\once \override TextScript #'staff-padding = #2.6
+\once \override TextScript #'staff-padding = #4.6
 c4^"piu mosso" fis a g
 @end lilypond
 
@@ -99,6 +101,8 @@ means
 that the result can overlap with other objects.
 
 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
+  % temporary code to break this example:
+  \override TextScript #'outside-staff-priority = ##f
 \once \override TextScript #'extra-offset = #'( 1.0 . -1.0 )
 e4^\markup{ \italic ritenuto } g b e
 @end lilypond
@@ -109,6 +113,8 @@ movement (up is positive).  After a bit of experimenting, we decided
 that these values look good
 
 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
+  % temporary code to break this example:
+  \override TextScript #'outside-staff-priority = ##f
 \once \override TextScript #'extra-offset = #'( -1.6 . 1.0 )
 e4^\markup{ \italic ritenuto } g b e
 @end lilypond
@@ -132,15 +138,17 @@ the command, omit the @code{\once}.  To stop this tweak, use a
 @ref{The \override command}.
 
 @lilypond[quote,fragment,ragged-right,verbatim,relative=3]
+  % temporary code to break this example:
+  \override TextScript #'outside-staff-priority = ##f
 c4^"piu mosso" b
-\once \override TextScript #'padding = #2.6
+\once \override TextScript #'padding = #4.6
   a4 b
 c4^"piu mosso" d e f
-\once \override TextScript #'padding = #2.6
+\once \override TextScript #'padding = #4.6
 c4^"piu mosso" d e f
 c4^"piu mosso" d e f
 \break
-\override TextScript #'padding = #2.6
+\override TextScript #'padding = #4.6
 c4^"piu mosso" d e f
 c4^"piu mosso" d e f
 \revert TextScript #'padding
diff --git a/input/regression/tuplet-bracket-cross-staff.ly b/input/regression/tuplet-bracket-cross-staff.ly
new file mode 100644 (file)
index 0000000..58c4321
--- /dev/null
@@ -0,0 +1,21 @@
+\version "2.11.16"
+\paper { ragged-right = ##t }
+\layout {
+  \context {
+    \Score
+    \override TupletBracket #'bracket-visibility = ##t
+  }
+}
+
+voice = {
+  \times 2/3 { b8 \change Staff=RH c' d' }
+  \times 2/3 { d' c' \change Staff=LH b }
+}
+
+\score {
+  \new PianoStaff
+  <<
+    \new Staff = "RH" { s4 s4 s4 }
+    \new Staff = "LH" { \clef bass \voice }
+  >>
+}
\ No newline at end of file
index d8235760ac08978fb469e6805d22bc31ea1b91a2..4604f5439d0173ae9c048f448ee341a77644190f 100644 (file)
@@ -353,7 +353,7 @@ Constrained_breaking::initialize ()
 
          line.force_ = forces[i*breaks_.size () + j];
          if (ragged && last && !isinf (line.force_))
-           line.force_ = (line.force_ < 0) ? infinity_f : 0;
+           line.force_ = (line.force_ < 0 && j > i + 1) ? infinity_f : 0;
          if (isinf (line.force_))
            break;
 
index a5ea54e77e69fa0bd784114e4e77ab7facae6708..3680c7374965477060e1c652ec463267ed5d725e 100644 (file)
@@ -27,7 +27,7 @@ public:
   DECLARE_SCHEME_CALLBACK (height, (SCM));
   DECLARE_SCHEME_CALLBACK (outside_slur_callback, (SCM, SCM));
   DECLARE_SCHEME_CALLBACK (pure_outside_slur_callback, (SCM, SCM, SCM, SCM));
-  DECLARE_SCHEME_CALLBACK (cross_staff, (SCM));
+  DECLARE_SCHEME_CALLBACK (calc_cross_staff, (SCM));
   DECLARE_GROB_INTERFACE();
   static Bezier get_curve (Grob *me);
 };
index c9b509ce7dc036fa05fac8a0627b3c48864a0baf..7de67b0f7421c563c6d2969cbd64df9b07b8fc03 100644 (file)
@@ -54,6 +54,6 @@ public:
   DECLARE_SCHEME_CALLBACK (width, (SCM smob));
   DECLARE_SCHEME_CALLBACK (pure_height, (SCM, SCM, SCM));
   DECLARE_SCHEME_CALLBACK (height, (SCM));
-  DECLARE_SCHEME_CALLBACK (cross_staff, (SCM));
+  DECLARE_SCHEME_CALLBACK (calc_cross_staff, (SCM));
 };
 #endif
index 2097e98d58dd79934b7d326a0f866ba7e06d2329..ccc2c22bfc769a597e78f35ed873d0164690613d 100644 (file)
@@ -19,6 +19,7 @@ public:
   DECLARE_SCHEME_CALLBACK (calc_control_points, (SCM));
   DECLARE_SCHEME_CALLBACK (print, (SCM));
   DECLARE_SCHEME_CALLBACK (calc_connect_to_neighbors, (SCM smob));
+  DECLARE_SCHEME_CALLBACK (calc_cross_staff, (SCM));
   
   DECLARE_GROB_INTERFACE();
   static Grob* get_common_x (Spanner *);
index 81aac6823f13214cc13f4ae53d885492f9514028..9900ba713b48d086afdcdde7ba252232247a202b 100644 (file)
@@ -47,7 +47,6 @@ class Slur_engraver : public Engraver
 protected:
   DECLARE_TRANSLATOR_LISTENER (slur);
   DECLARE_ACKNOWLEDGER (accidental);
-  DECLARE_ACKNOWLEDGER (dynamic_line_spanner);
   DECLARE_ACKNOWLEDGER (fingering);
   DECLARE_ACKNOWLEDGER (note_column);
   DECLARE_ACKNOWLEDGER (script);
@@ -112,12 +111,6 @@ Slur_engraver::acknowledge_accidental (Grob_info info)
   acknowledge_extra_object (info);
 }
 
-void
-Slur_engraver::acknowledge_dynamic_line_spanner (Grob_info info)
-{
-  acknowledge_extra_object (info);
-}
-
 void
 Slur_engraver::acknowledge_fingering (Grob_info info)
 {
@@ -224,7 +217,6 @@ Slur_engraver::stop_translation_timestep ()
 }
 
 ADD_ACKNOWLEDGER (Slur_engraver, accidental);
-ADD_ACKNOWLEDGER (Slur_engraver, dynamic_line_spanner);
 ADD_ACKNOWLEDGER (Slur_engraver, fingering);
 ADD_ACKNOWLEDGER (Slur_engraver, note_column);
 ADD_ACKNOWLEDGER (Slur_engraver, script);
index 1bb88339a6d254a540956d12d067d1ca8d55416f..8c2e36106f8a410e8bfd414c058ed477d7177283 100644 (file)
@@ -356,9 +356,9 @@ Slur::auxiliary_acknowledge_extra_object (Grob_info const &info,
                    e->name().c_str ()));
 }
 
-MAKE_SCHEME_CALLBACK (Slur, cross_staff, 1)
+MAKE_SCHEME_CALLBACK (Slur, calc_cross_staff, 1)
 SCM
-Slur::cross_staff (SCM smob)
+Slur::calc_cross_staff (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
   Grob *staff = Staff_symbol_referencer::get_staff_symbol (me);
index 862163fad9785987c6414eb58348998e557016a3..97f1cd24bfe1572c6d6f47331150c3ae7492f74a 100644 (file)
@@ -1012,9 +1012,9 @@ Stem::is_cross_staff (Grob *stem)
   return beam && Beam::is_cross_staff (beam);
 }
 
-MAKE_SCHEME_CALLBACK (Stem, cross_staff, 1)
+MAKE_SCHEME_CALLBACK (Stem, calc_cross_staff, 1)
 SCM
-Stem::cross_staff (SCM smob)
+Stem::calc_cross_staff (SCM smob)
 {
   return scm_from_bool (is_cross_staff (unsmob_grob (smob)));
 }
index 489d3bc76e58eff0cf199c4b78b31fd398195e98..faa25a85ca6a06e9203c3fde6fa6fed830855b83 100644 (file)
@@ -542,8 +542,11 @@ Tuplet_bracket::calc_position_and_height (Grob *me_grob, Real *offset, Real *dy)
       
 
       Real ss = 0.5 * Staff_symbol_referencer::staff_space (me);
-      Real lp = ss * robust_scm2double (stems[LEFT]->get_property ("stem-end-position"), 0.0);
-      Real rp = ss * robust_scm2double (stems[RIGHT]->get_property ("stem-end-position"), 0.0);
+      Real my_parent_offset = me->get_parent (Y_AXIS)->relative_coordinate (commony, Y_AXIS);
+      Real lp = ss * robust_scm2double (stems[LEFT]->get_property ("stem-end-position"), 0.0)
+        + stems[LEFT]->get_parent (Y_AXIS)->relative_coordinate (commony, Y_AXIS) - my_parent_offset;
+      Real rp = ss * robust_scm2double (stems[RIGHT]->get_property ("stem-end-position"), 0.0)
+        + stems[RIGHT]->get_parent (Y_AXIS)->relative_coordinate (commony, Y_AXIS) - my_parent_offset;
 
       *dy = rp - lp;
       points.push_back (Offset (stems[LEFT]->relative_coordinate (commonx, X_AXIS) - x0, lp));
@@ -654,6 +657,8 @@ Tuplet_bracket::calc_position_and_height (Grob *me_grob, Real *offset, Real *dy)
     Kind of pointless since we put them outside the staff anyway, but
     let's leave code for the future when possibly allow them to move
     into the staff once again.
+  
+    This doesn't seem to support cross-staff tuplets atm.
   */
   if (*dy == 0
       && fabs (*offset) < ss * Staff_symbol_referencer::staff_radius (me))
@@ -737,6 +742,24 @@ Tuplet_bracket::add_tuplet_bracket (Grob *me, Grob *bracket)
   Pointer_group_interface::add_grob (me, ly_symbol2scm ("tuplets"), bracket);
 }
 
+MAKE_SCHEME_CALLBACK (Tuplet_bracket, calc_cross_staff, 1);
+SCM
+Tuplet_bracket::calc_cross_staff (SCM smob)
+{
+  Grob *me = unsmob_grob (smob);
+  Grob *staff_symbol = 0;
+  extract_grob_set (me, "note-columns", cols);
+  for (vsize i = 0; i < cols.size (); i++)
+    {
+      Grob *stem = unsmob_grob (cols[i]->get_object ("stem"));
+      Grob *stem_staff = Staff_symbol_referencer::get_staff_symbol (stem);
+      if (staff_symbol && (stem_staff != staff_symbol))
+        return SCM_BOOL_T;
+      staff_symbol = stem_staff;
+    }
+  return SCM_BOOL_F;
+}
+
 ADD_INTERFACE (Tuplet_bracket,
               "A bracket with a number in the middle, used for tuplets. "
               "When the bracket spans  a line break, the value of "
index 54032803e9d0f216f402ec01404a113de04c2488..22d857bdd2a2a2fb04f34eef3877de334230d2f1 100644 (file)
@@ -17,6 +17,7 @@
 struct Tuplet_number
 {
   DECLARE_SCHEME_CALLBACK (print, (SCM));
+  DECLARE_SCHEME_CALLBACK (calc_cross_staff, (SCM));
   DECLARE_GROB_INTERFACE ();
 };
   
@@ -66,6 +67,13 @@ Tuplet_number::print (SCM smob)
   return stc_scm;
 }
 
+MAKE_SCHEME_CALLBACK (Tuplet_number, calc_cross_staff, 1)
+SCM
+Tuplet_number::calc_cross_staff (SCM smob)
+{
+  Grob *me = unsmob_grob (smob);
+  return unsmob_grob (me->get_object ("bracket"))->get_property ("cross-staff");
+}
 
 ADD_INTERFACE (Tuplet_number,
               "The number for a bracket. "
index 63df32b9a9f067f54ceeb99571c546ab359c96e8..49b9a32bac4494f9ca6adfbb59b7cacdd91717d0 100644 (file)
        (minimum-length . 1.5)
        (height-limit . 2.0)
        (ratio . 0.333)
-       (cross-staff . ,ly:slur::cross-staff)
+       (cross-staff . ,ly:slur::calc-cross-staff)
        (meta . ((class . Spanner)
                 (interfaces . (slur-interface))))))
 
        (height-limit . 2.0)
        (ratio . 0.25)
        (avoid-slur . inside)
-       (cross-staff . ,ly:slur::cross-staff)
+       (cross-staff . ,ly:slur::calc-cross-staff)
        (meta . ((class . Spanner)
                 (interfaces . (slur-interface))))))
 
        (Y-extent . ,ly:stem::height)
        (length . ,ly:stem::calc-length)
        (thickness . 1.3)
-       (cross-staff . ,ly:stem::cross-staff)
+       (cross-staff . ,ly:stem::calc-cross-staff)
        (details
         . (
            ;; 3.5 (or 3 measured from note head) is standard length
        (connect-to-neighbor . ,ly:tuplet-bracket::calc-connect-to-neighbors)
        (control-points . ,ly:tuplet-bracket::calc-control-points)
        (stencil . ,ly:tuplet-bracket::print)
+       (cross-staff . ,ly:tuplet-bracket::calc-cross-staff)
        
        (meta . ((class . Spanner)
                 (interfaces . (line-interface
        (font-shape . italic)
        (font-size . -2)
        (avoid-slur . inside)
+       (cross-staff . ,ly:tuplet-number::calc-cross-staff)
        (meta . ((class . Spanner)
                 (interfaces . (text-interface tuplet-number-interface
                                font-interface))))))