If, during the process of generating a signal, the user updates the values and durations from a longer array to a shorter array, the flock.ugen.sequencer unit generator will output NaNs.
This is due to the fact that we don't reset the sequencer's current index into these arrays when the inputs are changed. As a result, if the sequencer has already read from a higher sequence position than the new input's length, it will fail when trying to read out-of-bounds indices.
We should always reset the sequence index (i.e. model.idx) when the values or durations inputs change.
If, during the process of generating a signal, the user updates the
values
anddurations
from a longer array to a shorter array, theflock.ugen.sequencer
unit generator will output NaNs.For example, this will fail:
This is due to the fact that we don't reset the sequencer's current index into these arrays when the inputs are changed. As a result, if the sequencer has already read from a higher sequence position than the new input's length, it will fail when trying to read out-of-bounds indices.
We should always reset the sequence index (i.e.
model.idx
) when thevalues
ordurations
inputs change.