GSoC 2020 Work Product: New and Improved Multimeasure Rests and Measure Repeats

Posted 3 years ago

Hello, all! This is the conclusion to my GSoC 2020 blog, summarizing and linking to my work for MuseScore over the past twelve weeks.

In brief, I added support for adjusting the style of multimeasure rests, switching to old-style multimeasure rests, preventing line breaks between selected measures, automatically numbering one-measure repeats, and creating two- and four-measure repeats with MIDI playback support and the ability to import from and export to MusicXML format.

The multimeasure rest code, which can be found in PR #6211, has been merged. The measure repeat code, which can be found in PR #6365, has not been merged yet as of August 27th.

For a complete description of what has been implemented, from a user’s perspective, see my introductory blog post here. I completed everything exactly as I had envisioned it, as I demonstrate in this video:

The gaps that remain should cause only the mildest inconveniences to the user, and are left unfilled because they tie into very knotty questions:

  • Pasting—while two-measure and four-measure repeats can be copied to the clipboard, at present when pasted they will be replaced by rests. Although in many situations the user would desire measure repeats to be pasted as they were copied, in other scenarios, such as when pasting onto a different beat than the selection originally started on, this is the most natural behavior. It is a result of code to automatically delete an existing measure repeat when any content is pasted that would conflict with it.
  • Fonts—the default Emmentaler music font does not contain any of the measure repeat symbols, and so draws them from Bravura as a fallback. Due to different default staff line thicknesses, the symbols do not fit quite right in Emmentaler. Editing the fonts was not something I was prepared to undertake.
  • Collision avoidance—measure repeats are not noticed by the “smart layout” feature. This was a compromise necessary in order to equalize (and minimize) the width of the measures associated with a measure repeat. Under the hood (and *very* well disguised), a two-measure repeat has one measure containing the symbol and a second measure containing a concealed rest, and a four-measure repeat similarly includes three measures of rests. Update: at the eleventh hour, an alternative was found and this compromise is no longer necessary.

Thank you to my mentor Marc Sabatella for his experienced advice and—twice three times—outright bugfixes. Thank you to MuseScore and Google for giving me this excellent summer occupation. And thank you to Nicolas Froment and Thomas Bonte (and Werner, rarely seen though he was) for welcoming an inept teenager and gently steering him in the right direction five years ago. Strange how now I’m here and you’re not. But it’s good to be back.


Fantastic job, all looks wonderful and nicely polished! I know a lot of people will be thrilled once this becomes available.

BTW, one thing I only just today thought to test: linked parts. You might play around a bit and see what you think, maybe write out some thoughts for what else might make sense going forward.

Hi Isaac, message arrived, although with some delay ;) I'm amazed with the learning curve you went through and what you achieved with this gsoc project. Kuddos to Marc for mentoring you! All the best with your future endeavors!

Thank you all for adding these! I believe this will largely reduce the clutter in my lead-sheets.
This is so exciting that I am foreseeing a move to a nightly build in order to try this functionality out.