You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Tone.Sampler within a React app to play notes on the keyboard. I'm using the onload constructor param to track when the sampler is ready to play, and enable my keyboard based on this. However, I noticed that when I play a note right after the keyboard gets enabled (by spamming the taps, for example), I get a buffer error: Error: No available buffers for note: 60.
I've tried it in Safari and Firefox, both seem to have this issue, Firefox less frequently.
When I put a small timeout on setting the loading state of a sampler, I can eliminate this behaviour, but ideally I would like to not rely on hardcoded timeouts.
Expected behavior
I would expect the onload to allow to reliably set loading state to false.
What I've tried
When I put a small timeout on setting the loading state of a sampler, I can eliminate this behaviour, but ideally I would like to not rely on hardcoded timeouts.
The text was updated successfully, but these errors were encountered:
Describe the bug
I'm using Tone.Sampler within a React app to play notes on the keyboard. I'm using the onload constructor param to track when the sampler is ready to play, and enable my keyboard based on this. However, I noticed that when I play a note right after the keyboard gets enabled (by spamming the taps, for example), I get a buffer error:
Error: No available buffers for note: 60
.I've tried it in Safari and Firefox, both seem to have this issue, Firefox less frequently.
When I put a small timeout on setting the loading state of a sampler, I can eliminate this behaviour, but ideally I would like to not rely on hardcoded timeouts.
To Reproduce
Here's a codesandbox example.
Expected behavior
I would expect the onload to allow to reliably set loading state to false.
What I've tried
The text was updated successfully, but these errors were encountered: