From c33c8455627494cfe36eced4103f51eeb9bf5f5a Mon Sep 17 00:00:00 2001 From: Tijmen Zwaan Date: Fri, 16 Oct 2026 11:15:50 +0200 Subject: [PATCH] Use fractional values in cyclist --- packages/core/cyclist.mjs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/core/cyclist.mjs b/packages/core/cyclist.mjs index dea2b0597..945d792eb 100644 --- a/packages/core/cyclist.mjs +++ b/packages/core/cyclist.mjs @@ -78,12 +78,12 @@ export class Cyclist { // Sort the haps based on their onset, so cps changes within the // tick duration happen in the correct order. .sort((a, b) => { - const aBegin = a.whole.begin.valueOf(); - const bBegin = b.whole.begin.valueOf(); + const aBegin = a.whole.begin; + const bBegin = b.whole.begin; // If haps happen at the same time, trigger the haps that cause // cps changes first, so the durations of the simultaneous haps // are adjusted accordingly. - if (aBegin === bBegin) { + if (aBegin.eq(bBegin)) { if (a.value.cps !== undefined) { return b.value.cps !== undefined ? 0 : -1; } @@ -92,7 +92,7 @@ export class Cyclist { } return 0; } - return aBegin - bBegin; + return aBegin.sub(bBegin); }); haps.forEach((hap) => {