- Moment l = m->get_length ();
- repeat_ = m;
- start_mom_ = now_mom ();
- stop_mom_ = start_mom_ + l;
-
- Music *body = Repeated_music::body (m);
- body_is_sequential_ = body->is_mus_type ("sequential-music");
-
- int elt_count = body_is_sequential_ ? scm_ilength (body->get_property ("elements")) : 1;
-
- if (body_is_sequential_ && elt_count != 2)
- m->origin ()->warning (_f ("expect 2 elements for chord tremolo, found %d", elt_count));
-
- if (elt_count <= 0)
- elt_count = 1;
-
- Rational total_dur = l.main_part_;
- Rational note_dur = total_dur / Rational (elt_count * Repeated_music::repeat_count (repeat_));
-
- total_duration_flags_ = max (0, (intlog2 (total_dur.den ()) - 2));
-
- flags_ = intlog2 (note_dur.den ()) -2;
-
- return true;
+ if (ASSIGN_EVENT_ONCE (repeat_, ev))
+ {
+ int type = scm_to_int (ev->get_property ("tremolo-type"));
+ /* e.g. 1 for type 8, 2 for type 16 */
+ flags_ = intlog2 (type) - 2;
+ expected_beam_count_ = scm_to_int (ev->get_property ("expected-beam-count"));
+ beam_dir_ = RIGHT;
+ }
+ }
+ else if (span_dir == STOP)
+ {
+ if (!repeat_)
+ ev->origin ()->warning (_ ("No tremolo to end"));
+ repeat_ = 0;
+ beam_ = 0;
+ expected_beam_count_ = 0;
+ beam_dir_ = CENTER;