From eadc2ca88a754ac5e7ba960b2db4c01cc40d887a Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 26 May 2016 10:44:13 +0200 Subject: [PATCH] fix maths thinko --- libs/ardour/audio_unit.cc | 6 +++--- libs/ardour/session_vst.cc | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libs/ardour/audio_unit.cc b/libs/ardour/audio_unit.cc index 37c96a30ca..15b63c8f37 100644 --- a/libs/ardour/audio_unit.cc +++ b/libs/ardour/audio_unit.cc @@ -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) { diff --git a/libs/ardour/session_vst.cc b/libs/ardour/session_vst.cc index 23cf0f8b00..21875ece46 100644 --- a/libs/ardour/session_vst.cc +++ b/libs/ardour/session_vst.cc @@ -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; }