Skip to content

Commit

Permalink
Update DPF yet again: vst time rework, fix lv2 export
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX committed Feb 28, 2019
1 parent b3f59e8 commit da73655
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions dpf/distrho/src/DistrhoPluginLV2export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ void lv2_generate_ttl(const char* const basename)
String manifestString;
manifestString += "@prefix lv2: <" LV2_CORE_PREFIX "> .\n";
manifestString += "@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n";
#if DISTRHO_PLUGIN_HAS_UI && DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
manifestString += "@prefix opts: <" LV2_OPTIONS_PREFIX "> .\n";
#endif
#if DISTRHO_PLUGIN_WANT_PROGRAMS
manifestString += "@prefix pset: <" LV2_PRESETS_PREFIX "> .\n";
#endif
Expand Down
6 changes: 3 additions & 3 deletions dpf/distrho/src/DistrhoPluginVST.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -973,12 +973,12 @@ class PluginVst : public ParameterCheckHelper
if (vstTimeInfo->flags & (kVstPpqPosValid|kVstTimeSigValid))
{
const double ppqPos = std::abs(vstTimeInfo->ppqPos);
const double ppqPerBar = static_cast<double>(vstTimeInfo->timeSigNumerator * 4) / vstTimeInfo->timeSigDenominator;
const int ppqPerBar = vstTimeInfo->timeSigNumerator * 4 / vstTimeInfo->timeSigDenominator;
const double barBeats = (std::fmod(ppqPos, ppqPerBar) / ppqPerBar) * vstTimeInfo->timeSigNumerator;
const double rest = std::fmod(barBeats, 1.0);

fTimePosition.bbt.bar = static_cast<int32_t>(ppqPos / ppqPerBar + 0.5) + 1;
fTimePosition.bbt.beat = static_cast<int32_t>(barBeats + 0.5) + 1;
fTimePosition.bbt.bar = static_cast<int32_t>(ppqPos) / ppqPerBar + 1;
fTimePosition.bbt.beat = static_cast<int32_t>(barBeats - rest + 0.5) + 1;
fTimePosition.bbt.tick = static_cast<int32_t>(rest * fTimePosition.bbt.ticksPerBeat + 0.5);
fTimePosition.bbt.beatsPerBar = vstTimeInfo->timeSigNumerator;
fTimePosition.bbt.beatType = vstTimeInfo->timeSigDenominator;
Expand Down
Binary file removed plugins/Kars/Screenshot.png
Binary file not shown.

0 comments on commit da73655

Please sign in to comment.