From d6d5903a24477f6a41d9501ffc80120b46b39553 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 26 May 2016 02:20:14 +0200 Subject: [PATCH] fix Audio Unit BBT --- libs/ardour/audio_unit.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/ardour/audio_unit.cc b/libs/ardour/audio_unit.cc index 9fc9416ac5..37c96a30ca 100644 --- a/libs/ardour/audio_unit.cc +++ b/libs/ardour/audio_unit.cc @@ -1765,9 +1765,10 @@ AUPlugin::get_beat_and_tempo_callback (Float64* outCurrentBeat, tmap.bbt_time (_session.transport_frame() + input_offset, bbt); if (outCurrentBeat) { + const double ppq_scaling = metric.meter().note_divisor() / 4.0; float beat; - beat = metric.meter().divisions_per_bar() * bbt.bars; - beat += bbt.beats; + beat = metric.meter().divisions_per_bar() * (bbt.bars - 1) * ppq_scaling; + beat += (bbt.beats - 1) * ppq_scaling;; beat += bbt.ticks / Timecode::BBT_Time::ticks_per_beat; *outCurrentBeat = beat; }