Skip to content
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

8604 improve volta unwinding #3371

Closed
wants to merge 2 commits into from

Conversation

jeetee
Copy link
Contributor

@jeetee jeetee commented Dec 27, 2017

no file format changes required, so should quite cleanly apply to 2.x as well; but does change volta interpretation.
Where 2.x currently requires the repeatlist of a volta to be set to the n-th time that measure/volta is encountered, this PR requires the repeatlist to reflect the human-readable logic of being the x-th repeat in total.

Applying this to 2.x will result in scores pre 2.2 with volta rendering a different playback roadmap than scores from 2.2+

 * no-repeat (13) shouldn't have an off-page invalid jump either
 * Jumps should be taken on last repeat
 * repeatlist should make human-sense, not (only) programmer-sense (9)
 * added 1,3/2,4 style test
 * added tests to determine when an open volta should end
 * added 'with repeats' tests
@Jojo-Schmitz
Copy link
Contributor

As it never worked as intended prior to this PR, I tend to think that we should fix it for 2.2 too, even if that means that playback may render differently, due to the tricks involved getting it to work half way decent in pre 2.2. Together with a sentence about 'Known incompatibilities' in the Release Notes of course...

@@ -30,7 +30,7 @@ Volta* Score::searchVolta(int tick) const
{
for (const std::pair<int,Spanner*>& p : _spanner.map()) {
Spanner* s = p.second;
if (s->type() != ElementType::VOLTA)
if (!s->isVolta())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this and some more isXxx() and toXxx() won't fit for 2.2.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed.. if desired by @lasconic I could rework this into two separate commits, then the first one would remain 2.x compatible and all "codestyle" changes into a 2nd commit?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can handle this. Give me a couple of days to try the PR and see how much it improve the current situation and break compatibility.

@MarcSabatella
Copy link
Contributor

FWIW, I definitely applaud any improvement that can be made here, and would be willing to bear the pain of some incompatibility if it means we can finally have a more intuitive and logical story to tell. Right now, of all the FAQ's we get, it is the questions about volta behavior that bother me the most, because we just don't have great answers.

However, completely breaking compatibility - so that even the most basic tunes with a single repeat and two voltas no longer works - would make me uncomfortable. I'd like to understand better just how bad it will be.

@jeetee
Copy link
Contributor Author

jeetee commented Dec 28, 2017

It will 'break' the most simple volta song from 2.x if the volta properties for it had been altered to achieve correct playback in 2.x

If you simply had consecutive voltas, 2.x required you to set the repeat lists as follows:
volta_flaws_in_v2
With this PR, only the first one of those voltas will be played back, and the other two will be skipped entirely. The now 'correct' way to set the repeat lists is as follows:
volta_flaws_corrected_in_pr

The bonus is that this currently is how the repeat lists are set for the palette items in 2.x already. So a user would in the most basic scenarios no longer be required to fiddle with the repeatlist property at all.

…6, fix #148276, fix #230531, fix #267778: improve volta playback

unwindSection using RepeatList as how a human will notate the volta: using the n-th time a startRepeat is taken, also slightly modified the jump detection logic to have it check for jumps only upon the last passage of a measure
@jeetee jeetee force-pushed the 8604_improve_volta_unwinding branch from 5b60e48 to 53d34d4 Compare January 2, 2018 20:31
@Jojo-Schmitz
Copy link
Contributor

Jojo-Schmitz commented Jan 12, 2018

So this PR will break the playback of 2.x scores that used a workaround to get the playback right prior to this fix. IMHO this is a downside we can quite easily accept, we don't really need to maintain bug compatibility ;-)

@@ -112,14 +112,6 @@
</BarLine>
</Measure>
<Measure number="5">
<Jump>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get that. Why is it removed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok now I see the commit message "no-repeat (13) shouldn't have an off-page invalid jump either". In fact, this test was there to make sure that meaningless jump would do nothing. It should stay like this, and indeed the jump shouldn't be offpage.

@lasconic
Copy link
Contributor

lasconic commented Feb 6, 2018

Except my comment on test repeat13.mscx, it works great. I'm checking the code, and what needs to be done for 2.2.

if (m->prevMeasure()->sectionBreak())
break;

while ( (!m->repeatStart())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too much spaces here.

void repeat44() { repeat("repeat44.mscx", "1;2;3;4;5;3;6;3;4;1;7"); } // Jump from within a volta

void repeat45() { repeat("repeat45.mscx", "1;2;3;4;3;5;6;2;3;4;3;5;6;7"); } // repeat12 but with 'play repeats' enabled
void repeat46() { repeat("repeat46.mscx", "1;2;3;4;5;3;4;2;3;4;5;3;4;5;6"); } // repeat24 but with 'play repeats' enabled
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

too much spaces here too.

@lasconic
Copy link
Contributor

lasconic commented Feb 7, 2018

I fixed the issues mentioned earlier and merged the PR manually at 3087920 and dd2050e.
I will create a PR for 2.2 but I might need some help in order to create the missing test files in 2.x.

@lasconic lasconic closed this Feb 7, 2018
@lasconic
Copy link
Contributor

lasconic commented Feb 7, 2018

Here is the PR #3442

@jeetee jeetee deleted the 8604_improve_volta_unwinding branch February 7, 2018 11:47
lasconic added a commit that referenced this pull request Feb 7, 2018
Fix several issues with repeat and volta. Counterpart of PR #3371
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants