Files
ardour/libs/pbd
Robin Gareus 14da117bc8 Add explicit round/floor integer multiply/divide
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".
2022-10-22 02:10:05 +02:00
..
2020-11-07 10:37:52 +01:00
2022-04-23 23:12:13 +02:00
2020-10-13 21:27:16 +02:00
2020-03-18 18:16:29 +01:00
2020-10-13 21:27:16 +02:00
2021-05-05 17:57:16 +02:00
2015-10-05 16:17:49 +02:00
2021-12-31 01:39:39 +01:00
2021-06-26 18:47:08 -06:00
2020-12-02 21:34:52 +01:00
2020-10-13 21:27:16 +02:00
2022-09-10 10:20:37 +01:00
2021-06-26 18:40:44 -06:00
2022-09-21 19:09:55 -06:00