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
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
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
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
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
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
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
@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
--- /dev/null
+\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
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;
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);
};
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
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 *);
protected:
DECLARE_TRANSLATOR_LISTENER (slur);
DECLARE_ACKNOWLEDGER (accidental);
- DECLARE_ACKNOWLEDGER (dynamic_line_spanner);
DECLARE_ACKNOWLEDGER (fingering);
DECLARE_ACKNOWLEDGER (note_column);
DECLARE_ACKNOWLEDGER (script);
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)
{
}
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);
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);
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)));
}
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));
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))
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 "
struct Tuplet_number
{
DECLARE_SCHEME_CALLBACK (print, (SCM));
+ DECLARE_SCHEME_CALLBACK (calc_cross_staff, (SCM));
DECLARE_GROB_INTERFACE ();
};
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. "
(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))))))