Fix haps not being sorted by time

This commit is contained in:
Nikita
2025-10-25 18:53:24 +03:00
parent 8f9967c76d
commit 7d890156f4
+3 -1
View File
@@ -58,7 +58,9 @@ export async function renderPatternAudio(
});
logger('[webaudio] preloading');
let haps = pattern.queryArc(begin, end, { _cps: cps });
let haps = pattern
.queryArc(begin, end, { _cps: cps })
.sort((a, b) => a.whole.begin.valueOf() - b.whole.begin.valueOf());
for (const hap of haps) {
if (hap.hasOnset()) {