13
0

Tempo ramps - before the first meter, the beat is 0.0

This commit is contained in:
nick_m 2016-04-17 04:26:19 +10:00
parent 4820a11180
commit 94e7e4e53b

View 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();
}