@end ignore
+@item
+The visual style of tremolo slashes (shape, style and slope)
+is now more finely controlled.
+@lilypond[quote,relative=2]
+ a8:32 b: c: d:
+ \override StemTremolo.shape = #'beam-like
+ a: b: c: d:
+ \override StemTremolo.style = #'constant
+ a: b: c: d:
+ g,2
+@end lilypond
+
+
@item
Multi-measure rests have length according to their total duration,
under the control of @code{MultiMeasureRest.space-increment}.
--- /dev/null
+\version "2.19.8"
+
+\header {
+ texidoc = "Properties that control looks of tremolo slashes.
+ Slope is self-explanatory. Shape determines wheteher slashes look like
+ rectangles or like very small beams. Setting this properties directly
+ causes all slashes behave in the specified way. However, one usually
+ wants the slashes to behave differently depending on wheter the note
+ has flags, beams or only a plain stem. That's what style property
+ is used for: it sets shape and slope depending on situation.
+ There are two styles defined: default and constant."
+}
+
+music = {
+ a''4:32 a':
+ e''8: \noBeam e':
+ a'': [ a': ]
+ f': [ g':]
+ d': [ d': ]
+}
+
+\markup \wordwrap { default. First three notes should have beam-like slashes.
+Slash of the third note should be more sloped than first two notes.
+Slashes on beamed notes should be rectangular and parallel to the beams. }
+\new Staff {
+ \music
+}
+
+\markup \wordwrap { style=constant. All slashes should be rectangular.
+All slashes should have the same slope except for downstem flagged notes. }
+\new Staff {
+ \override StemTremolo.style = #'constant
+ \music
+}
+
+\markup \wordwrap { shape=rectangle. All slashes should be rectangular.
+Slope like in default. }
+\new Staff {
+ \override StemTremolo.shape = #'rectangle
+ \music
+}
+
+\markup \wordwrap { shape=beam-like. All slashes should be beam-like.
+Slope like in default. }
+\new Staff {
+ \override StemTremolo.shape = #'beam-like
+ \music
+}
+
+\markup \wordwrap { slope=-0.2 All slashes should have the same downward slope.
+ Shape like in default. }
+\new Staff {
+ \override StemTremolo.slope = #-0.2
+ \music
+}
DECLARE_SCHEME_CALLBACK (pure_calc_y_offset, (SCM, SCM, SCM));
DECLARE_SCHEME_CALLBACK (print, (SCM));
DECLARE_SCHEME_CALLBACK (width, (SCM));
- DECLARE_SCHEME_CALLBACK (calc_style, (SCM));
+ DECLARE_SCHEME_CALLBACK (calc_shape, (SCM));
DECLARE_SCHEME_CALLBACK (calc_direction, (SCM));
DECLARE_SCHEME_CALLBACK (pure_height, (SCM, SCM, SCM));
static Stencil raw_stencil (Grob *, Real slope, Direction stemdir);
Grob *stem = Grob::unsmob (me->get_object ("stem"));
Spanner *beam = Stem::get_beam (stem);
- if (beam)
+ SCM style = me->get_property ("style");
+
+ if (beam && !scm_is_eq (style, ly_symbol2scm ("constant")))
{
Real dy = 0;
SCM s = beam->get_property ("quantized-positions");
else
/* down stems with flags should have more sloped trems (helps avoid
flag/stem collisions without making the stem very long) */
- return scm_from_double ((Stem::duration_log (stem) >= 3 && get_grob_direction (me) == DOWN)
+ return scm_from_double ((Stem::duration_log (stem) >= 3
+ && get_grob_direction (me) == DOWN && !beam)
? 0.40 : 0.25);
}
return scm_from_double (((dir == UP && flag) || beam) ? 1.0 : 1.5);
}
-MAKE_SCHEME_CALLBACK (Stem_tremolo, calc_style, 1)
+MAKE_SCHEME_CALLBACK (Stem_tremolo, calc_shape, 1)
SCM
-Stem_tremolo::calc_style (SCM smob)
+Stem_tremolo::calc_shape (SCM smob)
{
Grob *me = Grob::unsmob (smob);
Grob *stem = Grob::unsmob (me->get_object ("stem"));
Direction dir = get_grob_direction (me);
bool beam = Stem::get_beam (stem);
bool flag = Stem::duration_log (stem) >= 3 && !beam;
+ SCM style = me->get_property ("style");
- return ly_symbol2scm (((dir == UP && flag) || beam) ? "rectangle" : "default");
+ return ly_symbol2scm (!scm_is_eq (style, ly_symbol2scm ("constant"))
+ && ((dir == UP && flag) || beam)
+ ? "rectangle" : "beam-like");
}
Real
Real thick = robust_scm2double (me->get_property ("beam-thickness"), 1);
Real width = robust_scm2double (me->get_property ("beam-width"), 1);
Real blot = me->layout ()->get_dimension (ly_symbol2scm ("blot-diameter"));
- SCM style = me->get_property ("style");
- if (!scm_is_symbol (style))
- style = ly_symbol2scm ("default");
+ SCM shape = me->get_property ("shape");
+ if (!scm_is_symbol (shape))
+ shape = ly_symbol2scm ("beam-like");
width *= ss;
thick *= ss;
Stencil a;
- if (scm_is_eq (style, ly_symbol2scm ("rectangle")))
+ if (scm_is_eq (shape, ly_symbol2scm ("rectangle")))
a = Lookup::rotated_box (slope, width, thick, blot);
else
a = Lookup::beam (slope, width, thick, blot);
ADD_INTERFACE (Stem_tremolo,
"A beam slashing a stem to indicate a tremolo. The property"
- " @code{style} can be @code{default} or @code{rectangle}.",
+ " @code{shape} can be @code{beam-like} or @code{rectangle}.",
/* properties */
"beam-thickness "
"flag-count "
"length-fraction "
"stem "
- "style "
+ "shape "
"slope "
);
values may also be specified - the unit is half the object width.")
(self-alignment-Y ,number? "Like @code{self-alignment-X} but for
the Y@tie{}axis.")
+ (shape ,symbol? "This setting determines what shape a grob
+has. Valid choices depend on the @code{stencil} callback reading
+this property.")
(sharp-positions ,list? "Sharps in key signatures are placed
within the specified ranges of staff-positions. The general form
is a list of pairs, with one pair for each type of clef, in order
(parent-alignment-X . ,CENTER)
(slope . ,ly:stem-tremolo::calc-slope)
(stencil . ,ly:stem-tremolo::print)
- (style . ,ly:stem-tremolo::calc-style)
+ (shape . ,ly:stem-tremolo::calc-shape)
(X-extent . ,ly:stem-tremolo::width)
(X-offset . ,ly:self-alignment-interface::aligned-on-x-parent)
(Y-extent . ,(grob::unpure-Y-extent-from-stencil ly:stem-tremolo::pure-height))