-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
alphaTex Alternate Endings #791
Conversation
I had now a look at your tests and it seems the alternate endings are not yet correctly applied. From a visual appearance of the file, I created a matching file in Guitar Pro. The correct order which GP and alphaTab should have, is: let expectedBars: number[] = [
0, 4, 8, // First round: 1st, 5th and 9th bar which have the ending for 1.
1, 5, 9, // Second round: 2nd, 6th and 10th bar which have the ending for 2
2, 3, 6, 7, 8 // Third round: 3rd, 4th, 7th, 8th and 9th which have the ending for 3.
// 3rd and 8th bar don't have the ending explicitly
// but extended from the previous bar.
]; Following rule seems the key difference:
In your test you expect the bars to be played which do not have any alternate endings defined, but that's not correct. The alternate endings stay valid. I attached you the GP7 file where I followed the actions described also in your alphaTex file. For the bars where you have defined the |
Alright, I see I've misunderstood the key difference. I was thinking that all bars in the AE would need to be explicitly included with an So, when an Also, in the test case run, I don't have GuitarPro, so I can't verify stuff in there, but I can load the |
As said: I would recommend comparing the alphaTex model to the one of GP and try to follow the same principle. 😉 The file was created by doing the same actions as specified also in alphaTex. Guitar Pro might also apply then the AEs explicitly to the subsequent bars as per the given rule. In best case the models are with the equal flags. |
Thanks for the guidance. I have now compared the models and understood the correct way to set flags. I also learned that the visuals of the repeats are also correct, so no issues remain. I refactored some code in the test case and fixed the previously incorrect counting of played bars. Now, the |
Avoiding DRY is always good. I like the principle of also writing test code clean like the production code. With tests it is often a bit difficult as you still want to keep them isolated/independent but keep the maintenance effort low. I think in this case it would make sense to try use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good now. @jonaro00 Is there anything you still want to extend/improve on this PR or is is also fully ready for integration from your side?
All looks good. You can go ahead and merge. 😄 |
Issues
Fixes #671
Proposed changes
The
\ae
bar meta tag for alphaTex can be used to mark bars as alternate endings in a repeat.Syntax examples:
\ae (1 2 3)
and\ae 4
.Checklist
MidiPlaybackController
added but needs a fix for passing.Further details