From: Han-Wen Nienhuys Date: Wed, 7 Feb 2007 19:32:07 +0000 (+0100) Subject: Merge branch 'master' of ssh+git://hanwen@git.sv.gnu.org/srv/git/lilypond X-Git-Tag: release/2.11.17-1~7 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=c74523f061cba5fb50d307ff04e3507c8b36f5c8;hp=49256d9f2e6c603bfa1682cb091501411d480a3a;p=lilypond.git Merge branch 'master' of ssh+git://hanwen@git.sv.gnu.org/srv/git/lilypond --- diff --git a/Documentation/topdocs/NEWS.tely b/Documentation/topdocs/NEWS.tely index 1e6e5b7da8..46a24d2db5 100644 --- a/Documentation/topdocs/NEWS.tely +++ b/Documentation/topdocs/NEWS.tely @@ -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 diff --git a/Documentation/user/running.itely b/Documentation/user/running.itely index 5709230bdd..981e71867a 100644 --- a/Documentation/user/running.itely +++ b/Documentation/user/running.itely @@ -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 diff --git a/Documentation/user/tweaks.itely b/Documentation/user/tweaks.itely index ad1280ef3a..0d48a53ee7 100644 --- a/Documentation/user/tweaks.itely +++ b/Documentation/user/tweaks.itely @@ -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 index 0000000000..58c4321985 --- /dev/null +++ b/input/regression/tuplet-bracket-cross-staff.ly @@ -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 diff --git a/lily/constrained-breaking.cc b/lily/constrained-breaking.cc index d8235760ac..4604f5439d 100644 --- a/lily/constrained-breaking.cc +++ b/lily/constrained-breaking.cc @@ -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; diff --git a/lily/include/slur.hh b/lily/include/slur.hh index a5ea54e77e..3680c73749 100644 --- a/lily/include/slur.hh +++ b/lily/include/slur.hh @@ -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); }; diff --git a/lily/include/stem.hh b/lily/include/stem.hh index c9b509ce7d..7de67b0f74 100644 --- a/lily/include/stem.hh +++ b/lily/include/stem.hh @@ -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 diff --git a/lily/include/tuplet-bracket.hh b/lily/include/tuplet-bracket.hh index 2097e98d58..ccc2c22bfc 100644 --- a/lily/include/tuplet-bracket.hh +++ b/lily/include/tuplet-bracket.hh @@ -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 *); diff --git a/lily/slur-engraver.cc b/lily/slur-engraver.cc index 81aac6823f..9900ba713b 100644 --- a/lily/slur-engraver.cc +++ b/lily/slur-engraver.cc @@ -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); diff --git a/lily/slur.cc b/lily/slur.cc index 1bb88339a6..8c2e36106f 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -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); diff --git a/lily/stem.cc b/lily/stem.cc index 862163fad9..97f1cd24bf 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -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))); } diff --git a/lily/tuplet-bracket.cc b/lily/tuplet-bracket.cc index 489d3bc76e..faa25a85ca 100644 --- a/lily/tuplet-bracket.cc +++ b/lily/tuplet-bracket.cc @@ -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 " diff --git a/lily/tuplet-number.cc b/lily/tuplet-number.cc index 54032803e9..22d857bdd2 100644 --- a/lily/tuplet-number.cc +++ b/lily/tuplet-number.cc @@ -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. " diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index 63df32b9a9..49b9a32bac 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -1256,7 +1256,7 @@ (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)))))) @@ -1455,7 +1455,7 @@ (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)))))) @@ -1576,7 +1576,7 @@ (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 @@ -1990,6 +1990,7 @@ (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 @@ -2002,6 +2003,7 @@ (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))))))