-
Notifications
You must be signed in to change notification settings - Fork 35
Description
Description:
When using the Track component to build a step sequencer, I've noticed that after adding and deleting multiple notes on a step, some notes persist indefinitely. These residual notes continue playing even if they are no longer present in the steps prop array.
Steps to Reproduce:
Build a step sequencer using the Track component, and pass an array of notes into the steps prop.
Add and delete multiple notes on a particular step multiple times via an onClick function that adds and removes notes from the array that's passed into the Track components steps prop.
Observe that after a few iterations, some notes continue to play indefinitely.
Observations:
Notes will infinitely sustain if there are no successive notes present.
Sustaining notes can be interrupted if other notes on a successive step are present.
Logging out the array on each step reveals, that even if the steps prop array is empty, playback and infinite note sustain still occur.
This behaviour was also observed in the piano roll step sequencer example from the documentation.
Suspected Cause:
It seems that the Track component might be caching some notes and not updating them correctly after they are deleted multiple times. This is based on the observation that even with an empty steps prop array, playback and infinite note sustain still happens.
Additional Information:
I've built a sequencer setup that's functionally very similar to the one in the documentation, and this issue was consistent in both my own version and the example in the docs.