diff --git a/packages/core/clockworker.js b/packages/core/clockworker.js index 8b2c1eb3..bcaf2872 100644 --- a/packages/core/clockworker.js +++ b/packages/core/clockworker.js @@ -4,9 +4,8 @@ // import createClock from './zyklus.mjs'; function getTime() { - - const seconds = performance.now() * .001; - return seconds + const seconds = performance.now() * 0.001; + return seconds; // return Math.round(seconds * precision) / precision; } diff --git a/packages/core/neocyclist.mjs b/packages/core/neocyclist.mjs index fe4cb0e2..ad22cf00 100644 --- a/packages/core/neocyclist.mjs +++ b/packages/core/neocyclist.mjs @@ -44,7 +44,7 @@ export class NeoCyclist { haps.forEach((hap) => { if (hap.hasOnset()) { const timeUntilTrigger = cycleToSeconds(hap.whole.begin - this.cycle, this.cps); - const targetTime = timeUntilTrigger + currentTime + this.latency + const targetTime = timeUntilTrigger + currentTime + this.latency; const duration = cycleToSeconds(hap.duration, this.cps); onTrigger?.(hap, 0, duration, this.cps, targetTime); } diff --git a/packages/core/util.mjs b/packages/core/util.mjs index 52296078..66f8d0db 100644 --- a/packages/core/util.mjs +++ b/packages/core/util.mjs @@ -415,7 +415,6 @@ export class ClockCollator { //when the clock offsets surpass the delta, set the new reference time if (Math.abs(rollingOffsetTime - this.offsetTime) > this.offsetDelta) { this.offsetTime = rollingOffsetTime; - } } @@ -423,7 +422,7 @@ export class ClockCollator { } calculateTimestamp(currentTime, targetTime) { - return this.calculateOffset(currentTime) + targetTime + return this.calculateOffset(currentTime) + targetTime; } }