+ /* Stem tremolo is never applied to a note by default,
+ is must me requested. But there is a default for the
+ tremolo value:
+
+ c4:8 c c:
+
+ the first and last (quarter) note bothe get one tremolo flag. */
+ int requested_type
+ = scm_to_int (tremolo_ev_->get_property ("tremolo-type"));
+ SCM f = get_property ("tremoloFlags");
+ if (!requested_type)
+ {
+ if (scm_is_number (f))
+ requested_type = scm_to_int (f);
+ else
+ requested_type = 8;
+ }
+ else
+ context ()->set_property ("tremoloFlags", scm_from_int (requested_type));
+
+
+ /*
+ we take the duration log from the Event, since the duration-log
+ for a note head is always <= 2.
+ */
+ Stream_event *ev = gi.event_cause ();
+ Duration *dur = unsmob_duration (ev->get_property ("duration"));
+
+ int tremolo_flags = intlog2 (requested_type) - 2
+ - (dur->duration_log () > 2 ? dur->duration_log () - 2 : 0);
+ if (tremolo_flags <= 0)
+ {
+ tremolo_ev_->origin ()->warning (_ ("tremolo duration is too long"));
+ tremolo_flags = 0;
+ }
+
+ if (tremolo_flags)