fix maths thinko
authorRobin Gareus <robin@gareus.org>
Thu, 26 May 2016 08:44:13 +0000 (10:44 +0200)
committerRobin Gareus <robin@gareus.org>
Thu, 26 May 2016 08:44:13 +0000 (10:44 +0200)
libs/ardour/audio_unit.cc
libs/ardour/session_vst.cc

index 37c96a30cab77f84fc4ed1ec1b768000c8e64818..15b63c8f37b3b4933c8080f666e6fd8a02098b16 100644 (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) {
index 23cf0f8b001fa96edf9117907cf726ea2e720d91..21875ece4654c41b6b194f023248bb831a2958ca 100644 (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;
 }