mirror of
https://codeberg.org/armin/mindball.git
synced 2026-09-01 03:40:49 +02:00
fix sync delay
This commit is contained in:
parent
482d5c3cbd
commit
2e85d45983
4 changed files with 35 additions and 3 deletions
|
|
@ -231,6 +231,13 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
static float syncTimeMs (int index, double bpm)
|
||||
{
|
||||
const int idx = std::clamp (index, 0, numDivisions - 1);
|
||||
const double secondsPerBeat = 60.0 / std::max (1.0, bpm);
|
||||
return static_cast<float> (divisionBeats[static_cast<std::size_t> (idx)] * secondsPerBeat * 1000.0);
|
||||
}
|
||||
|
||||
private:
|
||||
static float softClip (float x)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue