Debug loop range squishing

Multimedia / Ardour - Robin Gareus [gareus.org] - 28 June 2022 01:01 UTC

When the loop-range is defined in BeatTime, the disk-reader encounters rounding issues due to time-domain mismatches.

With a simple session fixed BPM at 120, 48kHz. looping 1 bar exactly 2 sec at the start of the session:

Range::squish start: b0 end: b7680 squish: a113554560 Range::squish using modulo: b45 = a661500 Range::squish using modulo in TD: a5760 Range::squish using earlier(): a658560

The correct answer is a113554560 - 2 * 56448000 [SC/sec] = a658560

Calculating the modulo iteratively is not great, however usually only one iteration is required.

ee350362d3 Debug loop range squishing
libs/temporal/range.cc | 42 ++++++++++++++++++++++++++++++++++++++++++
libs/temporal/temporal/range.h | 7 +------
2 files changed, 43 insertions(+), 6 deletions(-)

  • Share