The definition of addNote has a (byte typed) step param (with a default value of -1); therefore the following code (lines 369-372):
if(step == -1)
position = _quantizedPosition();
else
position = step;
should result in position being equal to _quantizedPosition() when you omit the step from the addNote call.
However a byte doesn't allow for a negative value (and -1 gets silently casted to 255: see https://www.arduino.cc/reference/en/language/variables/data-types/byte/). Therefore when omitting the step (or setting it to -1) the actual value will be 255 and consequently the position will also result in 255... and not what we expect.
The definition of
addNote
has a (byte typed)step
param (with a default value of -1); therefore the following code (lines 369-372):should result in
position
being equal to_quantizedPosition()
when you omit thestep
from the addNote call.However a
byte
doesn't allow for a negative value (and -1 gets silently casted to 255: see https://www.arduino.cc/reference/en/language/variables/data-types/byte/). Therefore when omitting the step (or setting it to -1) the actual value will be255
and consequently theposition
will also result in255
... and not what we expect.Typing the
step
param asbyte
solves this.