Browse Source

Calculate VST ppqPos in a more reliable way

Fixes #795

Signed-off-by: falkTX <falktx@falktx.com>

Conflicts:
	source/backend/plugin/CarlaPluginVST2.cpp
tags/v1.9.14
falkTX 5 years ago
parent
commit
40acc271c3
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      source/backend/plugin/CarlaPluginVST2.cpp

+ 4
- 3
source/backend/plugin/CarlaPluginVST2.cpp View File

@@ -1170,11 +1170,12 @@ public:
CARLA_SAFE_ASSERT_INT(timeInfo.bbt.beat > 0, timeInfo.bbt.beat);

const double ppqBar = double(timeInfo.bbt.bar - 1) * timeInfo.bbt.beatsPerBar;
const double ppqBeat = double(timeInfo.bbt.beat - 1);
const double ppqTick = timeInfo.bbt.tick / timeInfo.bbt.ticksPerBeat;
// const double ppqBeat = double(timeInfo.bbt.beat - 1);
// const double ppqTick = timeInfo.bbt.tick / timeInfo.bbt.ticksPerBeat;

// PPQ Pos
fTimeInfo.ppqPos = ppqBar + ppqBeat + ppqTick;
fTimeInfo.ppqPos = fTimeInfo.samplePos / (fTimeInfo.sampleRate * 60 / fTimeInfo.tempo);
// fTimeInfo.ppqPos = ppqBar + ppqBeat + ppqTick;
fTimeInfo.flags |= kVstPpqPosValid;

// Tempo


Loading…
Cancel
Save