Allow not hiding empty staves if only one system can be included on the page

• Jul 23, 2019 - 23:09

The "hide empty staves" feature is very handy to save space and to allow more music to be included on each page, if that is possible. However, sometimes hiding empty staves in two consecutive systems is not enough to allow inclusion of both systems on the same page. This happens particularly with orchestral scores when both systems include more than half of non-empty staves. Plain "hide empty staves" leaves, in those cases, a large blank space below the only system that can be included on the page. This looks untidy and unprofessional.

It would be nice to have an option to unhide empty staves when hiding them won't save pages anyway. This could be done either automatically from the score style settings, valid for all pages for which this condition holds, or manually on a per page basis.


I've proposed a "Never hide this measure" option that would force a staff to remain visible in its system if it were selected. This would give us the freedom to not hide empty staves on a case by case basis as needed. I do realize that this would mean making a plan, but I think its the most flexible and easiest way to implement something like this.

In my opinion, any "global" setting I would want to choose would fall into the category of "Never Hide".

In reply to by mike320

Your solution may be useful in certain cases, but I would prefer automation for most cases, otherwise it would be tedious in a 100 page score, for instance. Why not both options?
To prevent continuous relayout and the possible iterative preocess that Marc forsees, with the consequence of slowing down the interface, the feature could be enabled at the final stage, when all notes and symbols have been already written.

FWIW, while I have nothing against the option, I would take issue with the claim that it's unprofessional. In fact I've never seen a professionally-published score that hid empty staves on some pages but left them in on others just because they couldn't fit. The reasons for hiding empty staves isn't just to save space, it's also to reduce visual clutter. So the vast majority scores that hide empty staves at all do it across the board. I looked through the Norton Anthology and couldn't find a single example.

I will say that implementing such an option would be possible but not easy because by the time we have figured out a second system won't fit, it's too late to affect the layout of the first system. So we'd have to do this in multiple passes. But that's also the sort of thing we'd need to do in order to implement something that is more commonly requested - min/max staff distances analogous to the min/max system distances, so that underfull systems are automatically stretched out to the bottom margin. That's not uncommon, and is recommended by Gould - although it's also not uncommon to simply see ragged top/bottom margins.

In reply to by mike320

I never said no examples exist, but I do think it probably representative that the first 10-20 I looked at did not do this. Anyhow It doesn't matter how big the subset of scores that do this is - as I said, I have nothing against seeing the option implemented. Especially if the same approach actually allows for the min/max staff spacing that is actually common and recommended.

In reply to by Marc Sabatella

Former orchestra conductors want the instruments to be in the same place on every page. for example: Where the horns are on the previous page, they should be there on the next page.

In addition, these chefs (conductors) are able to play piano instantly on the full-score with a technique they developed/learned. I have seen that they have not succeeded in the new (paper-saving) versions. (Eyebrows rise up and eyes squint :) )

I've known maestros who complain about newly-printed, paper-saving scores and want to use old style versions.

Thank God the many Symphony Orchestras libraries has old versions of the classical works. But, I cannot say the same for the orchestral works of the new composers.

In reply to by Ziya Mete Demircan

I'm not a conductor, but frequently study orchestral works and follow recordings with the score, and what you say is correct, it is difficult to follow when the position of an instrumaent's staff changes permanently. There is one more thing: paper saving may be a need today (preserving forests, reducing chlorine, carbon footprint, etc.) but today there is also an alternative, inexistent until recent years, that could compensate that: printing on demand. So no need to print 500 copies, but only the one the conductor will use, so it may be acceptable to have a conductor-friendly version, rather than an environmentally friendly one.
That's why both approaches are useful.

In reply to by fmiyara

I am a conductor, and have experience with both kinds of scores. When possible, I prefer a score which shows all the instruments, empty staves and all. This is a luxury I seldom get to enjoy, though as theatrical scores are generally printed in condensed format. What concerns me more is poorly chosen line/page/section breaks. When I am finishing a score on MuseScore, one of the last steps in my process is to proofread for page breaks. (This can often open up possibilities for hiding empty staves in a way to save paper.)

One other point, though, is that by the time a conductor steps in front of an ensemble, they have usually done enough study of a score so that they know the idiosyncrasies and inconsistencies of a score, and have a good idea what is included/missing on a page. So it doesn't really matter if they've hidden the resting parts in a score. This, again, is especially important for theatre scores, where several instruments are indicated on any given stave.

Last point, I don't have particularly BAD eyesight, but I have yet to find a pair of glasses that allows me to clearly see both the score (around waist level) and the ensemble/cast. This means I tend to rely more on my knowledge of the score rather than the ability to read exact pitches during performance. (If I'm reading note names during performance, I've definitely done something wrong!)

In reply to by toffle

If I created scores exclusively for myself, I would take a different approach than I do, but most scores I do are intended to be converted to Braille. The purpose of the Braille version is to have the same page layout as the source PDF so a blind person can consult with a seeing person without difficulties. As a result, I want a score that is decent looking for a seeing person also. This means not having pages with 3 staves on them. Never hiding empty staves is sometimes an option and other times leads to layout issues for the sighted users (like the need to decrease the scaling to the point that the page is unreadable), especially when multiple movements are in a score and the instrumentation changes from one movement to another.

In reply to by mike320

Hmm, that's an interesting twist. As far as I know, the exported MusicXML file is essentially the same regardless of whether hide empty staves is used (I just did a quick check to verify this). All measures of all staves are written, no special indication is made as to which staves might be hidden on which system, or indeed, that hide empty staves was used at all. Any optimization of the layout for Braille would have to be done in the program converting MusicXML to Braille, or so it would seem to me. But I wonder if there is some way that this could be handled differently?

In reply to by Marc Sabatella

Before I started being concerned with Braille export, if 3 pages could be fit on one by hiding staves, I was fine with that, it didn't matter that the score had fewer pages than the source PDF. Now that I want the scores to match the PDF in pagination, I do what I can to make it look decent for people with sight. BTW, hhpmusic, who does most of the conversion to Braille, doesn't put empty staves in his Braille versions.

In reply to by Marc Sabatella

Sorry if the inclusion of the word "unprofessional" sounds ugly or unrespectful. Not my intention, but is the only word I can find that describes the look and feel of a printed score with lots of blanks below incomplete and uneven systems.

Indeed, I can't remember an orchestral score or of any other kind (from serious publishers, anyway) with any blank space below the last system of the page. If you need some examples, take for instance The Planets by Gustave Holst, Dover Edition, pp. 50-51 or 98-99 or 104-105 or many other pages. See also Tchaikovsky's Fourth Symphony, Heugel Editors, which can be downloaded from IMSLP; page 10, for instance, has several empty staves because the editor considered preferable to include all staves since hiding some of them would cause no benefit. But pp. 8 and 9 have many staves hidden since that way they can include two systems on each page. Another one: Stravinsky's Firebird, Dover edition, page 3 has one system with 6 empty staves and page 4 has three systems with all empty staves hidden. For the record, these are the ones I happen to have now on my desk

Definitely, the reason for hiding staves has nothing or very little to do with visual clutter, indeed it is much easier to follow a printed score during performance or study with all staves present since the eye tries to follow an horizontal line. Hiding staves is a tradeoff to allow paper saving.

See also the comments by Elaine Gould on page 522 of her book Behind bars. She will go even further, recommending a selection of which empty staves to keep, for instance those for instruments that will play soon.

Easy or not, the feature I'm asking for is necessary for professionally edited orchestral scores. The hide empty staves, as is now, is of little use. Getting an application as MuseScore is not easy either, but fortunately (and thankfully!) it has been created.

In reply to by fmiyara

To be clear, I am not disagreeing that having ragged margins is less desirable than balancing them, I was merely questioning the claim that the only professional way to balance them is to include all empty staves on these pages. Again, this simply is not my experience, nor is it what Gould recommends. The page you cite is a good example - it speaks of including some empty staves, which does indeed require some human intervention to choose intelligently.

And she also very explicitly states that the reason to hide empty staves is "so as not to clutter the score with blank staves" and "Do not include copious amount of blank staves as these are distracting, as are blank staves that enter and disappear at random". This confirms what I said about clutter. I'm not saying that this is the only reason to hide empty staves, but it is an important goal not to be ignored.

On 487-488 she gives the preferred method of spacing staves to achieve the desired balancing. But she also calls this balance "ideal", which is a far cry some saying that alternative is "unprofessional", and again, it doesn't more than cursory examination to find examples that do this.

Anyhow, I am now perfectly convinced that all of the discussion options are desirable: a way to "float" staff distances between min & max, a way to force all empty staves to display (despite Gould's caution against this), and a way to mark certain staves as "not empty" (useful in other contexts as well).

In reply to by Marc Sabatella

Marc, could you please provide some examples of first-rank publishers in which they prefer to remove all empty staves when there is only room for a single system on the page, at the cost of leaving blank spaces at the bottom of the page?

Your citation of Elain Gould "Do not include copious amount of blank staves (...)" surely does not refer to removing a few staves, but a lot (that's what "copious" mean: abundant, large number). In such case, very likely more than one system will fit into the page. But if only one system fits into the page, there is no reason for hiding staves if the result will be blank spaces at the bottom. This is what I'm trying to convey.

Of course I agree with the concept that in many cases the human intervention may be the best, and also agree that the more possibilities given to the user, the better, since more flexibility is available: automatic for a good out-of-the box presentation, and manual to achieve an outstanding look. Even the current hide empty staves feature would be useful in some cases, for instance to include comments, annotations, biographies, images, art, etc., taking advantage of the spare space so created.

In reply to by fmiyara

Please read what I wrote again. I acknowledge the ragged margin is not ideal, as does Gould. I am simply observing that the the min/max staff distance method is generally a better way of avoiding it, and it's the one Gould discusses first. Or some combination of that plus selectively showing some empty staves.

As for what constitutes "copious", consider a score that fills 51% of the page. Filling the page with 49% empty staves counts as copious in my book. Better to judiciously add a few then adjust the staff spacing.

In reply to by Marc Sabatella

I agree that adding 49 % empty staves is not the best, but if one seeks the possibility of an automatic first approximation, this is superior to just "hide all empty staves" as it currently works. Providing also the possibility of going further by manual editing is also welcome, since will help users looking for the ultimate refinement.

In reply to by Marc Sabatella

Just one more detail, if I haven't been clear enough: What I consider unprofesional is not the number of staves hidden or not, but the blank space below the system. If you can remove some strategically chosen staves to make room for other very populated staves, it is welcome, but this is very difficult to achieve automatically without AI or at least would require a very sophisticated algorithm taking into account many possibilities (*).
But the next best option, to allow all staves if only one system fits into the page, is far from being difficult. It is just a matter of counting the unempty staves in the current first system on the page and adding the number of unempty staves of the next. If the result is greater than the number of staves that fits into a page, just do not hide anything. When done, go ahead to the next system and repeat. Its a rather simple algorithm and will yield better results than the current version. May be it is not superb, but at least there are plenty of examples in the leading publishing houses where this is acceptable. The Holst example from Dover (reprint of Goodwin & Tabb, London) which I've provided earlier is representative of this. The Stravinsky example (also from Dover, but reprint of State Music Publishing House, Moscow) is more refined and does as Gould suggests.

(*) UPDATE: A basic algorithm doesn't seem so difficult after all, see proposal below.

In reply to by fmiyara

Some notes for possible rules/algorithm to perform selective staff hiding/unhiding automatically (for programmers only; take it or leave it)

The following proceeds sequentially starting on page 2. Page 1 usually shows all the staves, regardless of being empty or not, but if not, start on page 1
1) If after hiding empty staves a page has a blank below the last system that is smaller than 20 % of the page (or other suitable percentage, which could be a preference), then stretch the space between staves so that the last staff is aligned with the bottom margin.
2) If it is larger than 20 %, unhide some staves according to the following rules:
a) For each empty staff check if in the previous system it was unhidden; if so count the number of empty measures in that staff at the end of the last system, taking inf (infinite) or a very large number if the complete staff was also empty. Assign that number to an index Ai where i is the number of staff. If no previous system, set Ai = inf.
b) For each empty staff check if in the next system it is not empty; if so, count the number of empty measures in that staff at the beginning of the next system and assign it to an index Bi. If no next system, set Bi = inf
c) Define Ci as the minimum between Ai and Bi.
d) Unhide the empty staves starting from the one with the smaller Ci (i.e., the one having closer non-empty measures). If there are more than one with the same Ci, prefer those staves corresponding to bowed instruments, then brass, then woodwinds, then percussion. NOTE: The order of preference could also be an option
e) Keep unhiding staves until condition 1) is fulfilled and proceed as indicated there.

I believe these rules satisfy the suggestions by Elaine Gould and would provide a reasonable starting point, reducing clutter, saving paper and keeping a balanced and even look, right out of the box. The unhidden empty staves would restrict to those whose presence has some utility.

Of course, the user should be provided with a manual tool such as the one suggested by mike320 to tweak further the look of the score.

This feature could be disabled to avoid slowdown of the interface while entering notes or symbols, and definitely should be disabled for continuous view, where doesn't make any sense.

To sum up, these are the options that should be offered to provide great flexibility and fit different work styles:

1) Don't hide any staff (implemented)
2) Hide all empty staves except optionally on the first page (implemented)
3) Hide all empty staves except when no space will be saved (my proposal)
4) Manually choose what staves to hide, but reset (unhide) if layout change causes unempty measure to fall into the system (my new proposal)
5) Never hide this measure, staff containig it inherits the property (mike320's proposal)
6) Hide all empty staves but stretch staves separation within specified min/max limits to align with bottom margin (Marc's proposal)

Note: In 6) if max separation is reached but alignment cannot be attained, a warning should be issued and 3) should prevail with the possibility that the user apply 4) or 5).

7) Selectively hide empty staves combined with 6) ensuring no blank space is left at the bottom (combination of my proposal and Marc's; see above a possible starting point for an algorithm)

I wonder if adding an invisible and unplayable voice serves as a workaround or a measure with invisible notes counts as "empty".

In reply to by fmiyara

I can confirm that an invisible staff text doesn't count as non-empty, but if one chooses its color as white (or whatever is the background color) a staff without notes does show in the page view, so this could be a possible workaround (a bit cumbersome, since once changed to white it is difficult to know the text is there unless one manages to select it)

In reply to by fmiyara

I can also confirm that an invisible note in voice 2 whose "Play" property has been disabled from the inspector counts as a note, so the staff isn't considered empty and consequentley won't be hidden. The note will show on the screen in light gray, but will not be printed.
This simulates the solution "Never hide this staff" proposed by mike320 and can be used as a workaround until the feature is included in some future version.

In reply to by kuwitt

Yes, it is a discussion of pretty the same feature, thank you for recalling that.
What strikes me most is that the issue is quite old (2015) and has come back several times, but it has not been solved yet. It may be the single most important feature that MuseScore is still lacking to be able to produce large orchesral scores right out of the box--without too many workarounds, I mean.

In reply to by kuwitt

I think the "don't hide this measure" can be solved in a relatively easy way. Indeed, there must be some flag that triggers not hiding a staff. Currently that flag responds to emptyness or not. It would be a matter of setting that flag also by a property of each staff that could be set by the user through setting "don't hide this measure" in the measure properties dialog. That property is clear by default, and could be set in either of two ways: 1) creating (suggestion by mike320 from that discussion) a column in the measure properties dialog. 2) in the inspector for the specific measure, which when empty is equivalent to the inspector for the measure rest.

In reply to by fmiyara

it doesn't need to have any impact on parts

That's a tough one. If my suggestion of another column of check boxes in the measure properties were implemented, it would affect parts by default. You seem to be working on the assumption that people do not put invisible staves into parts, but I'm not sure about that.

In reply to by mike320

But an empty staff in a part doesn't seem to make sense. This setting shouldn't affect parts. In case a part needed really several staves, it only would be a problem if there are so many staves that is equivalent to a large ensemble. Are these cases common?

In reply to by fmiyara

These cases are not common but I'm opposed to making it impossible to not hide empty staves in parts if that's what a user wants. I suppose that if this is a fringe case, they could simply use another method for determining which staves to hide or not, like staff text invisible one place and not in the other.

In reply to by mike320

I retract what I said, sorry for being so thoughtless. I myself finally found a case: a first violin part with a solo part playing a small percentage of time: it is convenient to use 2 staves because the rest of the section may be playing another thing, but it is better if the solo staff is invisible when not playing in a given system.

In reply to by fmiyara

I'm actually not so crazy about the idea of making it a measure property. These normally apply to all staves. It's true there is a special hack to allow visibility to be per-staff, but even that really isn't so great (note you can't make all staves invisible). To me it's more natural to have this be a regular palette element you add to a specific measure/staff.

In reply to by Marc Sabatella

Measure/staff is the key word (if I get your idea), but extending to the whole staff/page if it happens to be on at a given layout state. I think that being a palette element would allow to be inherited by a part containing that specific measure/staff without affecting other staves or other parts containig different staves.
It could also have some properties to be controlled from the inspector, such as the number of measures from the next or previous non-empty measure, or the number of staves above or below to which the property automatically propagates. This would be useful since in several scores I've seen there's a grouping preference in the non-hidden empty staves, for instance, strings or horns. For intance, if there is a horn, and there is room for another staff, the other horn is generally preferred rather than, say, the clarinet (if the latter not preferred for another reason).

In reply to by fmiyara

I'm suggesting a measure determine if a staff in a system be hidden or not because systems are rather dynamic. As you enter notes the system will likely have fewer measures for example. If you insert a system break you may also change the number of measures and locations of systems afterward. When you say "Don't hide this system" what do you mean. If you identify a measure to define which system you do not want hidden then you get a better defined, less dynamic (though not necessarily an absolute) system to keep unhidden.

I think Marc's idea of a palette item to identify which measure determines the staff to not hide is probably the easiest to edit. The list in measure properties can get rather confusing since it is listed as Staff 1, Staff 2...Staff 37, Staff 38 and so on. This makes it quite difficult for the types of scores you and I want to be able to manage better.

As for which staves to not hide, that will be totally up to the user. You can almost emulate the idea the if there is only one horn show both staves by adding an instrument and changing all of the dynamics to staff for these instrument, then setting the hide when empty option to instrument. The problem is that you can't suddenly decide on page 84 that you do want the empty horn 3&4 staff to be hidden.

One thing that Marc has talked about is to make staff/part properties show the options for the selected measure taking into account instrument changes. So an instrument change in measure 15 would affect all measures until the next instrument change. If this were extended to staff type changes also, you could enter a staff type change, set the hide option, then enter another staff type change later and set a different hide option. This would be far less obvious, but it would be another option.

In reply to by mike320

FYI, my PR for making staff properties reflect the current instrument was merged, so it is in the current nighties. But it only affects instrument-level settings - the bottom half the dialog.

As for a more automatic scheme, I could imagine a new "bracketed group" option for "Hide when empty". It would work like the "instrument" option: the staff would be hidden only if all instruments in that bracketed group were empty. So you get all brass or no brass, all strings or no strings, etc. Not sure if that's useful, but it should be more easily doable than "show all staves if hiding empty staves doesn't allow an extra system".

In reply to by Marc Sabatella

Having bracketed groups of instruments does not sound useful to me because I'm more likely to have both oboes show on one page and then have the oboes merged on the next page than to either show or not show all of the empty woodwind staves. I'm of course never against giving users options especially when others like toffle seem to think it would be useful.

I've found a new problem regarding hidden staves. When two or more systems fit in a page, if the short instrument names differ in length, the barlines at the beginning of the different systems will be misaligned, presenting an uneven layout.

The algorithm should check which is the part with the longest instrument name in the whole page and arrange the first barline of all parts so that they are flush with the barline at the beginning of that part.

In reply to by fmiyara

Can you post links to examples of scores doing that? This seems non-standard to me as well. It would also be next to impossible to make happen, because we need to know how wide the instrument names are during the first pass of layout when we're deciding how many measures to fit on the system. If we wait until were done deciding on the whole page, then decide we need to artificially make the instrument names on the first system longer, that could easily result in fewer measures now fitting, and the process starts all over...

In reply to by Marc Sabatella

Find attached a simple example. On the second page the French horns from the second system have a longer name than the flutes and oboes from the first system so the system presents an indentation relative to the first system.
I see what you say, but it could be solved in a relatively easy way. Just start by a first guess: a worst case where the length of all instruments is taken into account. This will give a starting point. Then stretch automatically all measures to compensate for the difference between the longest name in the whole instrument list and the longest name after hiding the empty staves. This will not cause a noticeable unbalance between pages, since the difference in instrument name length is usually small.
Another solution, probably easier, is to just ignore, the instrument name length for computing the width of the system, and simply take a standard system width as if all instruments were present. The visual disruption caused by the misalignment of the longest instrument name is far less annoying or even noticeable than the misalingnment of the first barline. I can provide the example of Edition Eulenburg Ltd., who uses this criterion (example: Schostakowitsch's Symphony No 5, for instance page 17).

Attachment Size
Test_misaligned_first_barline.mscz 14.96 KB

In reply to by fmiyara

What you propose doesn't solve the problem at all, it just creates the opposite one, where now we may put too few measures on a system by default, then realize later we didn't need to overestimate the width of the instrument names, so we shorten them, and now there is room for another, measure, and the process starts again - or worse, the system is not as full as it should be.

I'd say if you want to force this sort of alignment, just pad your instrument names with spaces. Or use horizontal frames where necessary. Or if you're looking for something more automatic, maybe a style setting for "system left margin" to set a minimum the space between the page margin and the system barline (much like "music top margin" does).

To me any of these is a better solution that having bad spacing, or worse - having a change on the bottom system of a page inexplicably cause a different number of measures to fit on the top system. That's the sort of the thing that would be reported as a bug, and I'd agree.

In reply to by Marc Sabatella

Short names are and should be short. It is that way in all major publishing houses. Usually the difference between the longest and the shortest short name is at most a few millimeters so it is always possible to automatically distribute the difference over a full page width without causing a variation of the number of measures or any obvious bad spacing. In my example, about 4 mm to be distributed over 175 mm on average for an A4 paper size. This is less than 2.5 %, which would hardly cause a measure to jump to the next page (if it wasn't abnormally shrinked, anyway).
But, anyway, I've just looked at several scores from various publishers and they invariably choose the second solution: a uniform separation from the margin allowing for the longest short name (which is known in advance from the general score settings), be it present or not in a specific system. I cannot find any problem with this, since it is the same type of solution MuseScore already implements when one sets the score margins, only that in this case the application uses it as an internal setting. Choosisng it automatically is better in general than having to set manually a minimum space from barline to left margin, since it optimizes the use of avaliable space. Padding the names with spaces is not a definitive solution either, since it takes too much experimentation to get equal lengths (the fonts are not monospaced), it's only a workaround in the meantime.

In reply to by fmiyara

Good point about short names being short, you are right that in practice there won't be that much variation and using the max length over all staves isn't necessarily a problem.

But yes, a differences of 2.5% can easilynbe the difference between a measure fitting or not. Sometimes the differences is down to a fraction of an sp, which is why you see a measure change systems just by adding an accidental or whatever. So, this would have to be a one-way street - if one longer name wasn't being used anywhere on a page, we'd still have reserve space for it.

Feel free to submit an official Suggestion for this.

Reading this thread because of a related issue perhaps, since this deals with system spacing when staffs are hidden. I have a printed score in which the editor used a double line symbol (like an equal sign slightly tilted) between the sections. So if this were done in MuseScore after a system break when space allowed for a new section on the page instead of a hard page break, this symbol would be inserted before the new section started. Also this added more white space between the last staff and first staff of the two sections. Not sure if professionals need this feature but it helps to distinguish that a new section is beginning especially if the active instruments change from the previous section.

In reply to by msokol

When you "section" do you really mean "system"? It's quite standard to include system dividers between systems when placing multiple systems on a page if there is any possibility of confusion, and MuseScore already supports this, see Format / Style / System.

But if by "section" you really mean only between two sections in the MuseScore sense - we use that term for something that usually corresponds with movements in a larger work - then there should already be obvious visual separation from the frame you would generally add with the title of the new movement. If for whatever reason you aren't doing that, and want the divers only between movements and not between systems within the score, you can always add the system divider symbol manually, via the Symbols palette.

Either way, though, I'm not sure this directly relates to the discussion at hand?

In reply to by Marc Sabatella

My apology.. I meant system break not section. From you comments, I will look at the formatting section. This was the first time I attempted to digitize a symphonic score. I would only expect the system divider to be placed if there are multiple systems on a page. But I will explore. Thanks for the comments.

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