- for (SCM s = grouping; gh_pair_p (s);
- where += Rational (gh_scm2int (gh_car (s))) * bl,
- s = gh_cdr (s)
- )
- {
- int grouplen = gh_scm2int (gh_car(s));
- if (where == mp)
- {
- if (grouping_)
- {
- programming_error ("Huh, last grouping not finished yet.");
- continue;
- }
-
- grouping_ = make_spanner ("MeasureGrouping");
- grouping_->set_bound (LEFT, unsmob_grob (get_property ("currentMusicalColumn")));
- announce_grob (grouping_, SCM_EOL);
-
-
- stop_grouping_mom_ = now.main_part_ + Rational(grouplen - 1) * bl ;
- top_engraver ()->add_moment_to_process (Moment (stop_grouping_mom_));
-
- if (grouplen == 3)
- grouping_->set_grob_property ("style", ly_symbol2scm ("triangle"));
- else
- grouping_->set_grob_property ("style", ly_symbol2scm ("bracket"));
-
- break ;
- }
- }
+ for (SCM s = grouping; scm_is_pair (s);
+ where += Rational ((int) scm_to_int (scm_car (s))) * base_moment,
+ s = scm_cdr (s))
+ {
+ int grouplen = scm_to_int (scm_car (s));
+ if (where == mp)
+ {
+ if (grouping_)
+ {
+ programming_error ("last grouping not finished yet");
+ continue;
+ }
+ if (grouplen > 1)
+ {
+ grouping_ = make_spanner ("MeasureGrouping", SCM_EOL);
+ grouping_->set_bound (LEFT, Grob::unsmob (get_property ("currentMusicalColumn")));
+
+ stop_grouping_mom_ = now.main_part_ + Rational (grouplen - 1) * base_moment;
+ get_global_context ()->add_moment_to_process (Moment (stop_grouping_mom_));
+
+ if (grouplen == 3)
+ grouping_->set_property ("style", ly_symbol2scm ("triangle"));
+ else
+ grouping_->set_property ("style", ly_symbol2scm ("bracket"));
+
+ break;
+ }
+ }
+ }