Add info comment about ascending time order

This commit is contained in:
Nikita 2025-10-25 18:59:12 +03:00
parent 7d890156f4
commit c5250d7794

View file

@ -58,10 +58,11 @@ export async function renderPatternAudio(
});
logger('[webaudio] preloading');
// Calling superdough(...) in ascending onset time order is important
// for controls that depend on the audio graph state like `cut`
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()) {
try {