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

Refactor score unwinding #6248

Merged
merged 8 commits into from
Aug 25, 2020
Merged

Conversation

jeetee
Copy link
Contributor

@jeetee jeetee commented Jun 22, 2020

Resolves: issues with Jump/repeat combinations: #287447, #299320, #300362, #304795
#284887: crash on playback end in Debug build

Refactored unwinding to mimic "real" interpretation chain by a human over the previous copy-and-paste-rewind logic for jumps.

Also tracks section break pauses on RepeatSegments (but not used to fix related issue #32696 yet)

  • I signed CLA
  • I made sure the code in the PR follows the coding rules
  • I made sure the code compiles on my machine
  • I made sure there are no unnecessary changes in the code
  • I made sure the title of the PR reflects the core meaning of the issue you are solving
  • I made sure the commit message(s) contain a description and answer the question "Why do those changes fix that particular issue?" or "Why are those changes really necessary as improvements?"
  • I made sure the commit message title starts with "fix #424242:" if there is a related issue
  • I created the test (mtest, vtest, script test) to verify the changes I made

@@ -748,7 +748,7 @@ void MidiRenderer::collectMeasureEventsDefault(EventMap* events, Measure* m, con
// redirects to the correct function based on the passed method
//---------------------------------------------------------

void MidiRenderer::collectMeasureEvents(EventMap* events, Measure* m, const StaffContext& sctx, int tickOffset)
void MidiRenderer::collectMeasureEvents(EventMap* events, Measure const * m, const StaffContext& sctx, int tickOffset)
Copy link
Contributor

Choose a reason for hiding this comment

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

Correct me if I'm wrong, but don't we prefer const Measure* over Measure const *? Or maybe that's just an inconsequential thing, I don't know :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe the order wasn't specified in the "old" coding rules in effect on 3.x

The new ones indeed write const T* as a preference; but I'm still fighting that rule from a consistency pov, One should read type declarations from right to left and that would mean language natural that T const * makes more sense.
Anyhow.. let's not get into that discussion here.

If it must be changed to abide by coding rules, then I'll make that change; if I don't have to, then I won't ;-)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, please don't feel you have to just because I've piped up ;)

Copy link
Contributor

Choose a reason for hiding this comment

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

wow, I just realised that jeetee and jthistle were not the same person after all 😆
All that time I thought both were a short for johan temmerman, pointing to the same person...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Marr11317 Who says we're not the same person? 😇
I'm that talkative one that posts in the forums and occasionally fixes something.
James is the one that quietly fixes a bunch of stuff and occasionally speaks up.

Copy link

Choose a reason for hiding this comment

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

And I believe there's a certain difference in age. 😉

Copy link
Contributor

Choose a reason for hiding this comment

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

Not a big one

@anatoly-os
Copy link
Contributor

You really want to put these changes to 3.5RC, don't you? :) I suggest postponing to 3.5.1. What do you think?

@jeetee
Copy link
Contributor Author

jeetee commented Jun 23, 2020

3.5.1 is fine too @anatoly-os
I just didn't want it to wait for MS4 as the related bugs (especially D.S. at section break misfunctioning) does come up regularly (about once a month) in the forums.

And of course my code is so perfect that any PR I make warrants its own release just for the benefit of our users ;)

So yeah, preferably before 4 will do

@anatoly-os anatoly-os added this to the MuseScore 3.5.1 milestone Jun 23, 2020
@jeetee
Copy link
Contributor Author

jeetee commented Jun 27, 2020

3.5.1 is even better.
https://musescore.org/en/node/307231 exposed a bug with two volta's and a double repeat inbetween them.

|: | volta1 :||: volta2 | :|
wrongly includes the last measure of volta1 on the 2nd repeat

[EDIT:] fixed by commit below and added test::repeat56 to cover it.

…#304795

Refactor repeatlist unwinding

 - Fix D.S. issues
 - Support for jumping into Volta
 - Support for multiple jumps
 - Prepare section break indications for when the pause should really matter
 - Prepare repeatlist to include playbackCount for each segment, opening the way for play x-th time for all elements
…ach test now includes:

 * a description of its main purpose
 * the expected playback order
 * measure numbers
 * tempo marker of 400QPM
added test for jump targets under volta
@jeetee
Copy link
Contributor Author

jeetee commented Jul 31, 2020

Rebased and added test::repeat57 to cover https://musescore.org/en/node/274690#comment-1013746

if (tick > lastMeasure()->endTick()) {
// End Reverb may last longer than written notation, but cursor position should not
tick = lastMeasure()->endTick();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

See #6437

@anatoly-os anatoly-os merged commit 375b47e into musescore:3.x Aug 25, 2020
@anatoly-os
Copy link
Contributor

anatoly-os commented Aug 25, 2020

That was not the easiest one, but see 87a8931

anatoly-os added a commit that referenced this pull request Aug 25, 2020
@jeetee
Copy link
Contributor Author

jeetee commented Aug 25, 2020

Easy is a relative term ;-)
Thanks for the additional effort to port it to master!

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

6 participants