mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-08 22:55:44 +01:00
This fixes various rounding issues. Notably superclock to sample conversion must always round down when playing forward. `::process (start, end, speed = 1)` uses exclusive end. Processing begins at `start` and end ends just before `end`. Next cycle will begin with the current end. One example where this failed: - New session at 48kHz - Change tempo to 130 BPM - Enable snap to 1/8 note - Snap playhead to 1|3|0 - Enable Metronome - Play `assert (superclock_to_samples ((*i).sclock(), sample_rate()) < end);` end = 177231 samples == superclock 1042118280 A grid point is found at superclock 1042116920 (that is < 1042118280). However converting it back to samples rounded it to sample 177231 == end, while actual location is 1360 super-clock ticks before end. The metronome click has to be started this cycle, since the same position will not be found at the beginning of the next cycle, with start = 177232. Similarly a samplecnt_t t, converted to music-time and back must not be later than the given sample. ``` timepos_t tsc (t); assert (timepos_t::from_ticks (tsc.ticks ()).samples () <= t); ``` IOW. When playing forward, all super-clock time between 1|1|0 and 1|1|1 should round down to 1|1|0. "We have not yet reached the first tick". |
||
|---|---|---|
| .. | ||
| MSVCtemporal | ||
| temporal | ||
| test | ||
| bbt_time.cc | ||
| beats.cc | ||
| debug.cc | ||
| enums.cc | ||
| range.cc | ||
| superclock.cc | ||
| tempo.cc | ||
| test.cc | ||
| test2.cc | ||
| time.cc | ||
| timeline.cc | ||
| wscript | ||