GSoC 2020 Week 8 Recap: Model Design and Convincing Illusions

Posted 1 week ago

Hello! The last week ended up being quite different than what I had planned, but some solid improvements were made nonetheless.

Update from last week

PR #6211, my multimeasure rest work, was merged! I have now opened PR #6365 for my measure repeat work.


According to plan, I added an Inspector for MeasureRepeats. Not according to plan, the ground shifted under my feet and suddenly all my files were in the wrong place. I should have had PR #6372 on my radar. With @jeetee's help I was able to diagnose a problem that was preventing me from building entirely, and I then found the Inspector in my development build was always a blank white rectangle; finally, with @mattmcclinch's help, I got everything back in its proper place.

However, in deciding what to put in said Inspector, I had to put a lot of thought into how various pieces would fit together, which I will explain now because it has ramifications going forward.

Ordinarily, two- and four-measure repeats include a numeral 2 or 4, whereas one-measure repeats have no number. However, multiple consecutive one-measure repeats may have numerals indicating their position in the sequence, whereas this is not normally needed for two- or four-measure repeats due to their greater spacing. Furthermore, four-measure repeats are sometimes styled with horizontal extenders through the conjoined measures, whereas one- and two-measure repeats never are.

So, there are many ways an implementation could go wrong: it might allow extenders to be added to a one-measure repeat, or put a sequence count and a duration number on the same symbol, or even more confusing things which the engraver's mind dares not contemplate.

The model I decided on is, I think, a "least-bad" approach:

* Extenders are available only for four-measure repeats, and only as a score-wide style.
* Numbers "2" and "4" cannot be removed from two- and four-measure repeats, though their height can be adjusted, including on a per-element basis.
* One-measure repeats may have their number in a sequence displayed in the same position and style as the "2" or "4" of two- or four-measure repeats, except with the additional option of parentheses, and various adjustable parameters for when to display the numbers—all available as score-wide styles and not per-element properties.

All of which means that the only option in the new Inspector is for the number's position, and everything else will go in the Style dialog.

Maintaining the Illusion

Underlying rests are now protected from keyboard navigation and mouse click.


  • I ultimately decided to allow two- and four-measure repeats to be pasted as rests, because the alternative opened up a Pandora's box of new problems to squash.
  • I made the status bar/accessibility info for MeasureRepeats give their correct starting measure and duration.
  • My mentor Marc contributed a patch for the layout shift problem I described here.

Looking forward to this week

It's playback time! :-)

Previous post Next post