From ebf7afc482b82eb6351451621d1e25f7a68bf3ef Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 7 Jan 2023 05:16:14 +0100 Subject: [PATCH] Fix reporting tempo and time-signature to VST plugins #9188 --- libs/ardour/session_vst.cc | 4 ++-- libs/ardour/vst3_plugin.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/ardour/session_vst.cc b/libs/ardour/session_vst.cc index 20505821bf..805d65450e 100644 --- a/libs/ardour/session_vst.cc +++ b/libs/ardour/session_vst.cc @@ -189,12 +189,12 @@ intptr_t Session::vst_callback ( timeinfo->sampleRate = session->sample_rate(); if (value & (kVstTempoValid)) { - const Tempo& t (tmap->metric_at (now).tempo()); + const Tempo& t (tmap->metric_at (timepos_t (now)).tempo()); timeinfo->tempo = t.quarter_notes_per_minute (); newflags |= (kVstTempoValid); } if (value & (kVstTimeSigValid)) { - const Meter& ms (tmap->metric_at (now).meter()); + const Meter& ms (tmap->metric_at (timepos_t (now)).meter()); timeinfo->timeSigNumerator = ms.divisions_per_bar (); timeinfo->timeSigDenominator = ms.note_value (); newflags |= (kVstTimeSigValid); diff --git a/libs/ardour/vst3_plugin.cc b/libs/ardour/vst3_plugin.cc index bb5b719c82..22df1c3569 100644 --- a/libs/ardour/vst3_plugin.cc +++ b/libs/ardour/vst3_plugin.cc @@ -653,7 +653,7 @@ VST3Plugin::connect_and_run (BufferSet& bufs, { TempoMap::SharedPtr tmap (TempoMap::use()); - const TempoMetric& metric (tmap->metric_at (start)); + const TempoMetric& metric (tmap->metric_at (timepos_t (start))); const BBT_Time& bbt (metric.bbt_at (timepos_t (start))); context.tempo = metric.tempo().quarter_notes_per_minute ();