Commit 03b2a78
committed
Fix notes in the first tick of a song not playing when selected
Fixes #47
CAUSE:
To know when to play a column, the program checks when floor(marker_prevpos) != floor(marker_pos) (these variables correspond to the position of the marker in the previous frame and in the current frame, respectively). When the marker is at the absolute beginning of the song, its position is 0. Making its way to tick 1 of the song (second column), it will increase to one and that condition will only be met on the second tick, where pos and prevpos will be, for example, 1 and 0.9 [floor(1) != floor(0.9)]. That will never be true for the first tick of the song, since floor(<1) = 0, and, as such, it's never played.
SOLUTION:
An explicit check for the marker being in the beginning of the song AND marker_pos and prevpos being different (meaning you just started playing the song or dragged the marker) was added to the condition. This is not ideal, as it adds another check every tick in the song for something that only happens at the beginning. Ideally, there should be an overhaul in the program to set the marker position to -1 (or something like that) when the marker is at the beginning of the song.1 parent ca262c8 commit 03b2a78
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
0 commit comments