Skip to content

Commit 03b2a78

Browse files
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

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/selection_draw/selection_draw.gml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ w = argument2
1111
h = argument3
1212
draw_set_halign(fa_center)
1313
// Play
14-
if (floor(marker_pos) != floor(marker_prevpos) && marker_pos >= selection_x && marker_pos < selection_x + selection_l) {
14+
if ((floor(marker_pos) != floor(marker_prevpos) || (marker_prevpos == 0 && marker_pos != marker_prevpos)) && marker_pos >= selection_x && marker_pos < selection_x + selection_l) {
1515
xx = floor(marker_pos) - selection_x
1616
if (selection_colfirst[xx] > -1) {
1717
for (b = selection_colfirst[xx]; b <= selection_collast[xx]; b += 1) {

0 commit comments

Comments
 (0)