fix maths thinko

This commit is contained in:
Robin Gareus 2016-05-26 10:44:13 +02:00
parent 602344f0c5
commit eadc2ca88a
2 changed files with 4 additions and 3 deletions

View file

@ -1767,10 +1767,10 @@ AUPlugin::get_beat_and_tempo_callback (Float64* outCurrentBeat,
if (outCurrentBeat) {
const double ppq_scaling = metric.meter().note_divisor() / 4.0;
float beat;
beat = metric.meter().divisions_per_bar() * (bbt.bars - 1) * ppq_scaling;
beat += (bbt.beats - 1) * ppq_scaling;;
beat = metric.meter().divisions_per_bar() * (bbt.bars - 1);
beat += (bbt.beats - 1);
beat += bbt.ticks / Timecode::BBT_Time::ticks_per_beat;
*outCurrentBeat = beat;
*outCurrentBeat = beat * ppq_scaling;
}
if (outCurrentTempo) {

View file

@ -64,6 +64,7 @@ vst_ppq (const TempoMetric& tm, const Timecode::BBT_Time& bbt, double& ppqBar)
ppqBar *= ppq_scaling;
ppqBeat *= ppq_scaling;
ppqTick *= ppq_scaling;
return ppqBar + ppqBeat + ppqTick;
}