+ return (beam && beam->is_live ())
+ ? Beam::get_beam_translation (beam)
+ : (Staff_symbol_referencer::staff_space (me)
+ * robust_scm2double (me->get_property ("length-fraction"), 1.0) * 0.81);
+}
+
+Stencil
+Stem_tremolo::raw_stencil (Grob *me, Real slope, Direction dir)
+{
+ Real ss = Staff_symbol_referencer::staff_space (me);
+ 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 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 (shape, ly_symbol2scm ("rectangle")))
+ a = Lookup::rotated_box (slope, width, thick, blot);
+ else
+ a = Lookup::beam (slope, width, thick, blot);
+
+ a.align_to (X_AXIS, CENTER);
+ a.align_to (Y_AXIS, CENTER);
+
+ int tremolo_flags = robust_scm2int (me->get_property ("flag-count"), 0);
+ if (!tremolo_flags)
+ {
+ programming_error ("no tremolo flags");
+
+ me->suicide ();
+ return Stencil ();
+ }
+
+ Real beam_translation = get_beam_translation (me);
+
+ Stencil mol;
+ for (int i = 0; i < tremolo_flags; i++)
+ {
+ Stencil b (a);
+ b.translate_axis (beam_translation * i * dir * -1, Y_AXIS);
+ mol.add_stencil (b);
+ }
+ return mol;
+}
+
+MAKE_SCHEME_CALLBACK (Stem_tremolo, pure_height, 3);