Tempo ramps - before the first meter, the beat is 0.0
authornick_m <mainsbridge@gmail.com>
Sat, 16 Apr 2016 18:26:19 +0000 (04:26 +1000)
committernick_m <mainsbridge@gmail.com>
Fri, 27 May 2016 13:38:15 +0000 (23:38 +1000)
libs/ardour/tempo.cc

index 978d4ed05a81a168eaafe5cbe08878b8e59656f4..7aa86d38b0ce7ea8d43bbc58ed858dd3391628a8 100644 (file)
@@ -1542,6 +1542,9 @@ TempoMap::beat_at_frame_locked (const Metrics& metrics, const framecnt_t& frame)
 {
        const MeterSection& prev_m = meter_section_at_locked (metrics, frame);
        const TempoSection& ts = tempo_section_at_locked (metrics, frame);
+       if (frame < prev_m.frame()) {
+               return 0.0;
+       }
        return prev_m.beat() + (ts.pulse_at_frame (frame, _frame_rate) - prev_m.pulse()) * prev_m.note_divisor();
 }