+ /* 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_int2num (requested_type));
+
+ int tremolo_flags = intlog2 (requested_type) - 2
+ - (duration_log > 2 ? duration_log - 2 : 0);
+ if (tremolo_flags <= 0)
+ {
+ tremolo_ev_->origin ()->warning (_("tremolo duration is too long"));
+ tremolo_flags = 0;
+ }
+
+ if (tremolo_flags)
+ {
+ tremolo_ = make_item ("StemTremolo", tremolo_ev_->self_scm ());
+
+ /* The number of tremolo flags is the number of flags of the
+ tremolo-type minus the number of flags of the note itself. */
+ tremolo_->set_property ("flag-count", scm_int2num (tremolo_flags));
+ tremolo_->set_parent (stem_, X_AXIS);
+ stem_->set_property ("tremolo-flag", tremolo_->self_scm ());
+ tremolo_->set_property ("stem", stem_->self_scm ());
+ }