Browse Source

Double-resolution tick for carla-lv2 plugin

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.3.0-RC1
falkTX 4 years ago
parent
commit
5215baba29
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      source/utils/CarlaLv2Utils.hpp

+ 2
- 2
source/utils/CarlaLv2Utils.hpp View File

@@ -1015,12 +1015,12 @@ public:


const double rest = std::fmod(fLastPositionData.barBeat, 1.0f); const double rest = std::fmod(fLastPositionData.barBeat, 1.0f);
fTimeInfo.bbt.beat = static_cast<int32_t>(static_cast<double>(fLastPositionData.barBeat)-rest+1.0); fTimeInfo.bbt.beat = static_cast<int32_t>(static_cast<double>(fLastPositionData.barBeat)-rest+1.0);
fTimeInfo.bbt.tick = static_cast<int32_t>(rest*fTimeInfo.bbt.ticksPerBeat+0.5);
fTimeInfo.bbt.tick = rest * fTimeInfo.bbt.ticksPerBeat;


if (fLastPositionData.bar_f >= 0.0f) if (fLastPositionData.bar_f >= 0.0f)
{ {
fLastPositionData.bar_f += std::floor((fLastPositionData.barBeat+static_cast<float>(addedBarBeats))/ fLastPositionData.bar_f += std::floor((fLastPositionData.barBeat+static_cast<float>(addedBarBeats))/
fLastPositionData.beatsPerBar);
fLastPositionData.beatsPerBar);


if (fLastPositionData.bar_f <= 0.0f) if (fLastPositionData.bar_f <= 0.0f)
{ {


Loading…
Cancel
Save