-
Notifications
You must be signed in to change notification settings - Fork 95
Description
TT: copying Queue to a pattern erases complete pattern
Teletype v4.0.0 CBAEE74
What steps are required to reproduce the bug?
- load empty scene
- ensure you are in Live mode
- P 63 1 (in Live mode, set index 63 of working pattern to 1, working pattern is 0)
- Q 2 (in Live mode, place 2 into the queue)
- Q.N (in Live mode, get queue length: length is 1)
- Q.2P (in Live mode, copy entire queue to current pattern)
- TAB twice to see Tracker
- in Tracker, index 0 of pattern 0 contains 2 (expected)
- in Tracker, index 0 of pattern 0 contains 0 (unexpected, expected to still be 1 per step 3)
Notes
As I am not a developer, my code knowledge is extremely (!) limited, so please take the following with the proverbial grain of salt, as it is just a dilettante thinking out loud: Both lines 524 and 535 in teletype/src/ops/queue.c say
int8_t end_at = PATTERN_LENGTH < Q_LENGTH ? PATTERN_LENGTH : Q_LENGTH;
which to my naive understanding indicates that the copy process should end at either the pattern length (if it is shorter than the Queue length) or at the Queue length (if this is shorter than the Pattern length), which leads me to believe that the current behavior is a bug.
Beside this, clearing a whole pattern with 64 entries while copying a queue of 16 into the pattern seems a rather substantial data loss.
Thanks for having a look into this!