helge17 / tuxguitar

Improve TuxGuitar and provide builds
Other
489 stars 43 forks source link

Bug: Failure to start playing when start of loop range coincides with non-first "alternative repeat" #549

Closed lucmans closed 2 weeks ago

lucmans commented 1 month ago

When starting playback of tabs, with the loop range starting on an alternative repeat that is not the first alternative, playback stalls. See the added screenshot for reference. 2024-10-11-185056_252x151_scrot

guiv42 commented 1 month ago

reproduced with TuxGuitar 1.6.4

guiv42 commented 1 month ago

Very similar to #234 , but it seems the conditions to reproduce are not exactly the same. See video below, in this case it works fine even for alternative repeat 4.

https://github.com/user-attachments/assets/6a14f43c-e3ae-48e7-b282-8a3fbf40767a

@lucmans : could you please share what is the repeat structure before your measure 18?

lucmans commented 1 month ago

tab.zip I uploaded the file for reference.

guiv42 commented 1 month ago

Understood When parsing song, MidiRepeatController ignores every measure out of the defined loop. A first fix was applied (94bbab607cf7d0835eb8430534542b9570d23350) to consider simple repeats, but it's not sufficient. If a measure belongs to several alternative repeats, the following "repeat close" shall be executed several times. Currently, if this happens out of the selected loop, it is only considered once. See provided example file, measure 17 (outside of defined loop) belongs to alternative repeats 1,2, and 3. This results in an incorrect computation of what measures should be played in the loop. Fix coming soon.

guiv42 commented 1 month ago

should be better now

guiv42 commented 4 weeks ago

Fix is available from pre-release 2024-10-24 in both master and tuxguitar-next branches