mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-23 03:18:35 +00:00
prettier
This commit is contained in:
parent
4eae366bee
commit
2c9ea03fde
@ -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…
x
Reference in New Issue
Block a user