Negative staff spacer proposal

• Aug 1, 2015 - 17:43

There is currently no way to reduce the distance between two staves just for a single system, or to reduce the distance between two systems only. Spacers can be used to *increase* the distance in either case, and you can also reduce the distance between two staves score wide, or reduce the distance between *all* systems. But on multiple occasions it has been requested to have a "negative staff spacer" that worked just like the current spacers but allowed for negative spaces. See for instance #61041: Negative staff spacer.

As I am working on my ideas for ossia / cutaway staves (see https://musescore.org/en/node/71686), I'm increasingly aware of the need for something like this, so I decided to give that a shot as well.

It turns out it's actually not hard to make a normal staff spacer work this way, particular for the "down" spacer. That is, I can make it so adding such a spacer automatically sizes to the current staff distance, and you can then adjust it from there in either direction. It's a bit trickier to make this work as a *system* spacer because of the way systems can be "stretched" to fill the page, but I have that working at least partially as well.

Does anyone see a downside to simply changing the current spacer to work either way, as opposed to adding a separate negative spacer type? I could disable it for existing spacers in existing scores, so there would be no compatibility issues.

Or, does anyone have any alternate ideas for addressing these issues?


Comments

I love the idea, but for backward compatibility, the software has to assume, or user must be prompted to include, the spacers. Individual spacers would help the user in layout, which is the ultimate goal of MuseScore, I believe. It's great when the application can guess at it, and it usually comes up with a good layout automatically. But more than once have I needed to modify the space between staves and systems for whatever reason.

For cutaway staves, do you intend "off-staff" graphics to "intrude" on the spacer?

If you can have the software add user-modifiable spaces automatically, that's a true leap forward. The spacer would abide by the Style spacing, and the saved/printed file stores the extra spacing value for each spacer.

Keep up with the good work!

In reply to by harbinger

Thanks for the comments! I'm not sure I understand some of what you say, however.

What is your point about backward compatibility? My initial thinking is that, as I said, existing spacers in existing scores would not be affected. You'd need to delete them and add new ones to take advantage of the new functionality.

I also don't understand the question about off-staff graphics and cutaway staves.

Basically the only change I am proposing is this:

Right now, a spacer can only *add* space. A spacer with a size that is less than the current distance to the next staff will have no effect at all - only once you enlarge it past the next staff does it "push" the next staff further down. My change simply makes it so that if the size of the spacer is *less* than the current distance to the next staff, it will actually "pull" the next staff up:

negative-spacer-2.png

In reply to by harbinger

I still don't understand what you mean. There are many ways to override the staff spacing. You can change the default spaces for all staves within a system, for just any pair of staves within a system, the space between systems, etc, and that's all just via Style settings and Staff Properties. Spacers *are* the way to customize spacing "outside of the style"; they just don't work to *decrease*. That was the *only* thing missing, but my proposal changes that so that nothing is impossible any more.

Nice idea!

I would not worry over-much on backward compatibility. To me, if the existing spacers would start to work in both directions (opposed to down only, as now), it would not be a big problem. In the great majority of cases, there would be a difference between the old and the new behaviour only if the user added in an old score a spacer too short to reach the staff / system below and to actually push it down (then, actually doing nothing), without deleting it once noticing that it does nothing.

This may have happened of course, but I have the feeling that it is not so frequent and it is rather easy to spot and correct (i.e. delete the spacer, previously useless and now "counter-spacing").

Or am I missing something?

In reply to by Miwarre

I was thinking the same, but It turns out there are some other differences as well where one might legitimately want a spacer even though it seems to be ineffective. For instance, you might have a system which markings underneat for which the minimum system distance would not provide enough spacer but the page happens to have enough room to allow the systems to be stretched. You might add a spacer just big enough to cover the markings, so that if the layout changes in such a way that the systems can't be stretched, there is still enough room between those specific systems, but you don't actually want to defeat the stretch and limit the space to what you set in the spacer.

Not sure if that is clear, but no matter. I added an Inspector-accessible property "Allow shrink" (and I'm open to suggestions for a better name) to the "Vertical spacer down". It defaults to "off" so older scores continue to have the same behavior, but the version of the spacer in the palette has it explicitly set to "on" so newly placed spacers get the new behavior. You can turn the flag on or off at any time. Off, and it works as in 2.0. On, and it becomes not just a suggestion - "please give me at least this much space, but feel free to stretch systems beyond this as well" - but an absolute "give me exactly this much space". I could of course have both versions of the spacer on the palette, but I think it's overkill.

I have submitted a PR https://github.com/musescore/MuseScore/pull/2147. As I mentioned, it was relatively easy to get it to work with respect to staves within a system, and I have pretty high confidence in that code. Getting it to work as a system spacer was trickier, but it works in the cases I have tried, and if there is a case where it doens't do what one expects, you can always turn off the "Allow shrink" flag and be no worse off than before.

I like this idea! In addition to ensuring it works between systems, another thing to be careful of might be behavior if, say, a "Staff spacer down" ends up attached to a staff at the bottom of a page. Ideally, this, too, would automatically fit (in this case, between the staff and the bottom margin), and would also be adjustable. But this could get complicated; if the page is taken up by one tall system, then diminishing the space between the bottom of the system and the lower page margin can't really happen.

(Unless the minimum/maximum staff distance idea from https://musescore.org/en/node/61041#comment-279841 is implemented at the same time! But that could be an impossibly difficult beast to tackle.)

In reply to by Isaac Weiss

Yes, the min/max staff distance idea is a bigger can of worms, I think. And while it is a good solution for the particular use case I proposed it for, it doesn't really address other situations where a megative spacer could be useful. So I decided to tackle the spacer first, and may or may not work on the min/max staff distance idea.

I did test behavior with a spacer at the bottom of the page, and it works how I (at least) would expect. If the spacer is set to shrink the space enough to allow another system to fit, it does, otherwise, the effect is as if there were no spacer. I'm not quite sure if this is what you are asking about?

BTW, one nice thing in my implementation is that I tried hard to make it so that when you first add the spacer, it is automatically sized to the current distance to the next staff/system. So just as today, there is no immediate effect of adding a spacer. But the moment you start changing the spacer size (in either direction), the spacing tracks your changes immediately, rather than having that awkward period where you are wondering if the spacer is working at all.

In reply to by Marc Sabatella

As to "when you first add the spacer, it is automatically sized to the current distance to the next staff/system. So just as today, there is no immediate effect of adding a spacer":

Suppose the simple case of a one-instrument (one-staff) score. A spacer is added and fits itself between two systems without changing the distance between them. No adjustments to the spacer are made. Then, in the Page General Style settings, the minimum/maximum system distance is increased/decreased such that the lines are made further apart/closer together. Does the untouched spacer go along with the change, or does it keep the two lines it's connected to locked in relation to each other?

In reply to by Isaac Weiss

Just as today, changing a style setting has no effect on spacers. If you have a spacer with a heigh of 8sp, it will have a height of 8sp regardless of style setting. It sets the system distance "absolutely" by default.

Unchecking the "Shrink distance" (actual current name of option; I misspoke before) option restores the current behavior, but that is also the same in this respect: changes to the style settings will not affect the spacer. As I mentioned previously, though, this is a good use case for the old behavior, to allow you to have a spacer that requests "at least" a certain amount of space while otherwise still allowing the system distance to float according to the settings.

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