13
0

Fix reporting tempo and time-signature to VST plugins #9188

This commit is contained in:
Robin Gareus 2023-01-07 05:16:14 +01:00
parent 3ae7295142
commit ebf7afc482
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 3 additions and 3 deletions

View File

@ -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);

View File

@ -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 ();