libtemporal: add and use TempoMap::superclocks_per_grid_at() to return superclock duration of a measure/bar division. This corrects the results of ::get_grid()
This commit is contained in:
@@ -1825,7 +1825,7 @@ TempoMap::get_grid (TempoMapPoints& ret, superclock_t start, superclock_t end, u
|
||||
|
||||
if (bar_mod == 0) {
|
||||
|
||||
step = metric.superclocks_per_note_type_at_superclock (start);
|
||||
step = metric.superclocks_per_grid_at (start);
|
||||
start += step;
|
||||
DEBUG_TRACE (DEBUG::Grid, string_compose ("step for note type was %1, now @ %2\n", step, start));
|
||||
|
||||
|
||||
@@ -485,6 +485,10 @@ class LIBTEMPORAL_API TempoMetric {
|
||||
return _tempo->superclocks_per_note_type() * exp (-_tempo->omega() * (sc - _tempo->sclock()));
|
||||
}
|
||||
|
||||
superclock_t superclocks_per_grid_at (superclock_t sc) const {
|
||||
return int_div_round (superclocks_per_note_type_at_superclock (sc) * _tempo->note_type(), (int64_t) _meter->note_value());
|
||||
}
|
||||
|
||||
BBT_Time bbt_at (superclock_t sc) const;
|
||||
superclock_t superclock_at (BBT_Time const &) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user