+ Moment next_measure_pos = measure_pos + options.base_moment_;
+
+ while (i < infos_.size () && infos_[i].start_moment_ < next_measure_pos)
+ {
+ Moment dt = infos_[i].start_moment_ - measure_pos;
+
+ // The rhythmic importance of a stem between beats depends on its fraction
+ // of a beat: those stems with a lower denominator are deemed more
+ // important.
+ // FIXME: This is not the right way to do things for tuplets. For example,
+ // in an 8th-note triplet with a quarter-note beat, 1/3 of a beat should be
+ // more important than 1/2.
+ if (infos_[i].rhythmic_importance_ >= 0)
+ infos_[i].rhythmic_importance_ = (dt / options.base_moment_).den ();
+
+ i++;
+ }
+
+ measure_pos = next_measure_pos;
+ if (i < infos_.size () && infos_[i].start_moment_ == measure_pos)
+ infos_[i].rhythmic_importance_ = -1;