Skip to content

Commit

Permalink
Use 1920 as default ticks per beat, more common as default in daws
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX committed Jul 12, 2021
1 parent 2466710 commit 1b5a74a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions distrho/src/DistrhoPluginLV2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ class PluginLv2
fTimePosition.bbt.barStartTick = 0;
fTimePosition.bbt.beatsPerBar = 4;
fTimePosition.bbt.beatType = 4;
fTimePosition.bbt.ticksPerBeat = 960.0;
fTimePosition.bbt.ticksPerBeat = 1920.0;
fTimePosition.bbt.beatsPerMinute = 120.0;
#endif
fPlugin.activate();
Expand Down Expand Up @@ -359,7 +359,7 @@ class PluginLv2
if (obj->body.otype != fURIDs.timePosition)
continue;

LV2_Atom* bar = nullptr;
LV2_Atom* bar = nullptr;
LV2_Atom* barBeat = nullptr;
LV2_Atom* beatUnit = nullptr;
LV2_Atom* beatsPerBar = nullptr;
Expand Down
6 changes: 4 additions & 2 deletions distrho/src/DistrhoPluginVST2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,7 @@ class PluginVst : public ParameterAndNotesHelper
fTimePosition.bbt.valid = ((vstTimeInfo->flags & kVstTempoValid) != 0 || (vstTimeInfo->flags & kVstTimeSigValid) != 0);

// ticksPerBeat is not possible with VST
fTimePosition.bbt.ticksPerBeat = 960.0;
fTimePosition.bbt.ticksPerBeat = 1920.0;

if (vstTimeInfo->flags & kVstTempoValid)
fTimePosition.bbt.beatsPerMinute = vstTimeInfo->tempo;
Expand Down Expand Up @@ -1099,7 +1099,9 @@ class PluginVst : public ParameterAndNotesHelper
fTimePosition.bbt.beatType = 4.0f;
}

fTimePosition.bbt.barStartTick = fTimePosition.bbt.ticksPerBeat*fTimePosition.bbt.beatsPerBar*(fTimePosition.bbt.bar-1);
fTimePosition.bbt.barStartTick = fTimePosition.bbt.ticksPerBeat*
fTimePosition.bbt.beatsPerBar*
(fTimePosition.bbt.bar-1);

fPlugin.setTimePosition(fTimePosition);
}
Expand Down

0 comments on commit 1b5a74a

Please sign in to comment.