prettier
This commit is contained in:
parent
4eae366bee
commit
2c9ea03fde
3 changed files with 4 additions and 6 deletions
|
|
@ -4,9 +4,8 @@
|
||||||
// import createClock from './zyklus.mjs';
|
// import createClock from './zyklus.mjs';
|
||||||
|
|
||||||
function getTime() {
|
function getTime() {
|
||||||
|
const seconds = performance.now() * 0.001;
|
||||||
const seconds = performance.now() * .001;
|
return seconds;
|
||||||
return seconds
|
|
||||||
// return Math.round(seconds * precision) / precision;
|
// return Math.round(seconds * precision) / precision;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ export class NeoCyclist {
|
||||||
haps.forEach((hap) => {
|
haps.forEach((hap) => {
|
||||||
if (hap.hasOnset()) {
|
if (hap.hasOnset()) {
|
||||||
const timeUntilTrigger = cycleToSeconds(hap.whole.begin - this.cycle, this.cps);
|
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);
|
const duration = cycleToSeconds(hap.duration, this.cps);
|
||||||
onTrigger?.(hap, 0, duration, this.cps, targetTime);
|
onTrigger?.(hap, 0, duration, this.cps, targetTime);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -415,7 +415,6 @@ export class ClockCollator {
|
||||||
//when the clock offsets surpass the delta, set the new reference time
|
//when the clock offsets surpass the delta, set the new reference time
|
||||||
if (Math.abs(rollingOffsetTime - this.offsetTime) > this.offsetDelta) {
|
if (Math.abs(rollingOffsetTime - this.offsetTime) > this.offsetDelta) {
|
||||||
this.offsetTime = rollingOffsetTime;
|
this.offsetTime = rollingOffsetTime;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -423,7 +422,7 @@ export class ClockCollator {
|
||||||
}
|
}
|
||||||
|
|
||||||
calculateTimestamp(currentTime, targetTime) {
|
calculateTimestamp(currentTime, targetTime) {
|
||||||
return this.calculateOffset(currentTime) + targetTime
|
return this.calculateOffset(currentTime) + targetTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue