From 9e0b840afd0cbb6d686a8c88fada7dd338eec8ec Mon Sep 17 00:00:00 2001 From: Tristan de Cacqueray Date: Sun, 20 Oct 2024 15:13:49 -0400 Subject: [PATCH] Fix default uniformTrigger indexs --- packages/shader/uniform.mjs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/shader/uniform.mjs b/packages/shader/uniform.mjs index 4bf364967..0ce7896a2 100644 --- a/packages/shader/uniform.mjs +++ b/packages/shader/uniform.mjs @@ -106,12 +106,16 @@ export const uniformTrigger = register('uniformTrigger', (target, pat) => { // Decode the uniform target defintion const uniformDest = parseUniformDest(target); - // Assign pitch position by default - if (uniformDest.position === undefined) uniformDest.position = null; return pat.onTrigger((time_deprecate, hap, currentTime, cps, targetTime) => { const position = - uniformDest.position === null ? getNotePosition(uniformDest.name, hap.value) : uniformDest.position; + uniformDest.position === undefined + ? // Set the position based on the note by default + getNotePosition(uniformDest.name, hap.value) + : uniformDest.position === null + ? // The index is set to `seq` + getNextPosition(uniformDest.name, currentTime) + : uniformDest.position; const value = (hap.value.gain || 1) * (uniformDest.gain || 1);