2^n measures per system (casting-off)

• Feb 8, 2023 - 05:49

It'd be nice if there was a setting to automatically scale measures so each line has the largest power-of-two number of measures (1, 2, 4, 8) that will fit (unless overridden by a manual system break). I'm aware of the automatic system breaks dialog, and I already adjust minMeasureWidth to ensure 4 measures per system, but it'd be convenient if I could just place manual system breaks on my odd-length phrases and the remainder of the score automatically re-laid-out in a sensible way


Comments

I was able to put together a plugin that does what I wanted reasonably well: https://github.com/mrjacobbloom/castoff

This was a fun project and I learned a lot about MuseScore's plugins (and QML in general). That said, there are several extremely-janky hacks that I had to use, which could've been avoided if this was part of the built-in layout system instead:
- I had to store some data in the unused color fields of measures and section-breaks
- The only way to get the minimum widths for measures is to quickly switch to Continuous View and back :(
- Since this plugin tries not to interfere with the undo stack, the only way to force an engraving render was to toggle note-input mode :(

Despite my best efforts, it still doesn't always work correctly after you add a section-break, sometimes you have to manually hit "Content Changed. " For the second, it only works in MuseScore 3 since 4's Plugin API hasn't stabilized yet

Do you still have an unanswered question? Please log in first to post your question.