Skip to content

fix(SandboxSynth): pass index to unison voices forEach#170

Merged
mfwolffe merged 1 commit intoLab-Lab-Lab:mainfrom
espadonne:main
Apr 20, 2026
Merged

fix(SandboxSynth): pass index to unison voices forEach#170
mfwolffe merged 1 commit intoLab-Lab-Lab:mainfrom
espadonne:main

Conversation

@espadonne
Copy link
Copy Markdown

Summary

  • voices.forEach(voice => {...}) at components/audio/InstrumentSandbox/SandboxSynth.js:782 was missing the index argument, but the body still referenced i from an earlier for (let i...) loop used to build the voices array.
  • Result: ReferenceError: i is not defined when starting a unison voice — reproduced by a tester entering Arco from the Studio modal.
  • Fix takes the index directly from the forEach callback. Inner for (let i...) loops in the body each declare their own i, so no shadowing.

Worth manually verifying: open the Studio modal, select Arco, play a note, and confirm no runtime error. With unisonVoices > 1, check that the [SandboxSynth] Started voice N (k/numVoices) log lines report correct indices.

@mfwolffe mfwolffe merged commit 1061934 into Lab-Lab-Lab:main Apr 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants