Enforce no linebreak between measures

• Feb 9, 2014 - 19:54

Hi guys. First post, but I've been hacking scores for a while, inc. adding one to the sheet music repository. Thank you, MuseScore team, for your hard work!

I want to control the number of measures per line. I can force a line break by dragging the green symbol. But I also want to stipulate *no* line break between certain measures, possibly lots. I know that I can indirectly achieve some of this by using Style/stretch etc. But the most direct way to control this sort of thing is by break/no-break directives, which is common in word processing applications. The system adjusts the stretching based on the enforced breaks and no-breaks. I can't figure out how to do this, if it's possible.

FYI, I want to do this because I am transcribing some printed music, and for error checking I need the lines to be the same -- otherwise you get confused very quickly. I don't want to get bogged down in stretching stuff that I will forget when I come back in 6 months, etc. Thanks...


I would use the # of measures plugin first, either on the whole score or in pieces. Drag the breaks manually for special cases.

In reply to by xavierjazz

I tried your suggestion of the x measures plugin, xavierjazz. This appears to work in the obvious but simple way. It simply pops in a linebreak every so many measures, as the score is now. The break stays with the measure regardless of what else you add or delete. As you say, you can get it approximate by putting in breaks for a constant number of measures, and move the breaks as needed.

However, I have some long measures that are forcing premature breaks. I'd like to squish them by enforcing no-break on a line. I really don't want to go in by hand and tinker with stretching, as later when I change other stuff, the stretching will not be right. Maybe there's no solution.

I find the most effective method is to find a space and stretch setting that allow more measure per line than I need. I set this globally, then simply add breaks where I want.

I get the big (er, global) picture now. That's a good point Marc, to reduce stretch as much as possible globally, initially. Thanks guys.

I know this is 6 years on and all, but this should really be a built-in thing. It would save so much time. Hacks like changing spacing and bar stretching should be used AFTER the line-breaking has been applied, otherwise it's just too hard to fine-tune.

LilyPond has this functionality in the forms of \noBreak and \noPageBreak.

In reply to by Jojo-Schmitz

It was disabled because it didn't work, and there wasn't time to try to fix the problems. ANd it is indeed coming back for MuseScore 4 as part of Isaac's work.

But more importantly, it's not relevant to this discussion. The "no break" element was not and is not a way to force more measures onto a system. All it does is request two measures to be kept together if possible. So if you connect measures 6 & 7 with one of these, and there isn't room for measure 7 on a given system, it won't force that measure to fit - measure 7 will still be placed on the next measure - as will measure 6. So it is more like a "non breaking space" in a word processor. In other words, using this never results in more measures on a system, but it might result in fewer.

So the use case is not about squeezing more music onto a system, but more about preventing a line or page break in the middle of some fast complex passage that would make it hard to read. A nice feature to be sure, but nothing to do with the subject at hand.

A way to force more measures onto a system would be nice too for different reasons, and I've made suggestions for how I think such a feature could be designed and implemented, but I'm not aware of any work being done on this.

In reply to by jeetee

“All it does is request two measures to be kept together if possible.”
“using this never results in more measures on a system, but it might result in fewer.”

A true no-break would have to squeeze the measures (when necessary), otherwise the measures would not fit on the line.

In reply to by to7m

That seems wrong. How can a "do not break" instruction result in a line break "under most circumstances"? Surely if, say, measures 6 and 7 are configured to "not break", then measures 6 and 7 should always appear in the same system - where 6 goes, 7 goes with it, and vice versa.

However, it is currently possible to force any set of measures onto a single system (provided they fit on a single system) by inserting system breaks before and after them. I can not see the "do not break" option being useful other than as a convenience in some corner cases.

In reply to by SteveBlower

Maybe this is just because I am used to using line breaks and page breaks for formatting, but the only reason I can see to use a “do not break” is to prevent one that is happening. That won't happen with the current “no break”, as it would just put a line-break elsewhere — this for me would be redundant functionality because I could achieve the same effect by just manually putting a line-break elsewhere. The sole purpose of a “no break” for me would be to FORCE the bars (or lines for a “no break page”) to stay together.

In reply to by to7m

And to be clear, this is what it does: it forces them to stay together. it just doesn't say which system they will stay together on. In order for this feature to double as a "fit more measures than otherwise possible" feature - completely contrary to its intent - it would need to force 6 & 7 together onto the previous system, but what it actually is designed to do - exactly like a non=breaking space in a word processor - is force them together on the next system. So it does what it is supposed to do, exactly consistent with the name (although the name is changing indeed), it's just unrelated to what you want here.

In reply to by to7m

You mean, will it allow the measures to extend right off the page? No, just like a word processor won't do that either. Once again, it works just like a word processor, as it is intended to solve the same problem - keeping two things together where possible, not some sort of workaround for the unrelated issue of trying to specify exactly how many things should be on some particular line.

In reply to by to7m

If it's impossible to keep only the measures on the same system without one extending into the margin I would hope this would be the case. MuseScore has minimum distances for elements in the style setting that it should use for these. MuseScore never shrinks things to make them fit, but it will extend things so it looks decent (like a singe whole note in a 4/4 measure with a system break before and after it). The user has the option of override these minimums in various ways but MuseScore won't do that without intervention by the user.

In reply to by mike320

I'm sure there is some use for a feature that tries to do a no-break but ultimately still allows one in some cases, but I can't think of what that use might be. My use case, and as best I can tell the use case of the OP, is in a no-break that does squish things in whatever way is necessary, without compromise.

If these two features existed, I would assume that “no break” would refer to the uncompromising one by default. In LilyPond, noBreak means no-break, and there isn't a compromise. “The \noBreak command forbids a line break at the bar line where it is inserted.”

If both features get implemented at some point, then they need different names, and following the literal example already used by LilyPond would be best in my opinion.

In reply to by to7m

I would actually like to see MuseScore shrink things to make them fit within certain guidelines but not at all cost. I do a lot of symphonic pieces and I end up having to shrink the entire score because that's the only way to fit a page's worth of music on one page. It would be nice if there were an option where I could tell MuseScore to shrink that page (or those measures) as much as x% so they never get too small. I'm working on a piano score right now that will never permit two measures on the same system unless it is so small that you will never be able to read it if printed. MuseScore should not do this unless the user gives it explicit permission.

In reply to by to7m

The use case for which this feature was designed is exactly what I already described, and it's the same use case as in a word processor - when you have two things that really need to be seen next to each other for readability sake but you don't care which line they actually end up on. And just like in a word processor, it's up to you to make sure the two things you are trying to put next to each other can actually fit.

Again, think about how non-breaking spaces are used in a word processor and you will understand this feature. the feature was not designed to have anything to do with what you are trying to do. A totally new feature would be needed for that, and I think there are probably better ways to do it than by attaching break-like elements to the specific measures where you want the breaks not to occur. Much more natural, for example, would be a special type of break you attach to a measure that says, not only don't break immediately before me, but also don't break anywhere before me and the previous explicit break. So if you placed one of these on measure 5, and another on measure 12, this would force 6-12 onto one system whether the break would naturally have occurred after measure 6, 7, 8, 9, 10, or 11. There are other ways it could be designed also. but it would be better to do so thinking about the end result goal and the best way to get there, not limiting oneself to trying to shoehorn new functionality into an element that was never designed to do anything of the sort.

In reply to by Marc Sabatella

I get the analogy and the intention. I'm just saying that at some point there should be a strict no-break functionality (as in LilyPond), and that when that is introduced it will make the other functionality almost redundant, and that it would therefore be wise to give the current element a different name. I wasn't suggesting changing the functionality of the current element, but come to think of it, a true no-break would do exactly the same stuff up until the line needs to be split.

I think the non-breaking space analogy is incomplete, as in a word processor you can easily shrink text to fit by selecting the line and reducing the character spacing, whereas in MuseScore it is a bit more complicated. To get things to look right, you often have to make multiple adjustments, including moving chord symbols around, per-bar adjustments, etc, all while the visual result of adjusting all of these keeps jumping around when the last bar pops off to the next line thus making the previous bars stretch to fill the line.

I did consider whether an explicit do-break-but-only-here one would make more sense, but I think it would be problematic if accidentally deleted in a score, because it could cause hundreds of bars to be squashed together on the same line. But if for any reason it were easier to implement, I'd happily use it.

In reply to by to7m

Again, I agree someday it would be nice to support this other feature you mention. But doing so will in no way whatsoever diminish the need for the exist no break functionality. Again, completely different problem. There are tons of real world use cases where you simply want two measures together, but you don't care which system they appear on, and you don't want the music artificially compressed to make room for them. What you describe isn't a no break, its a "force all measures from X to Y to fit together on the same system". A good name should be chosen to reflect that.

The word processor analogy is very good, that's why I chose it ;-). Yes, in a word processor you can within certain limits try reducing character spacing, just as in MuseScore you can reduce stretch. True, MuseScore does add a few other wrinkles, but the concept is the same - only by getting into some pretty intricate manual adjustments can you force more things on a line than would otherwise fit, and none of this has anything whatsoever with non-breaking spaces. So best to just leave that out of it and start with a clean slate in imagining how to best design and implement a brand new, unrelated to anything MsueScore has ever seen before, "fit all measures from X to Y on a single system" facility.

In reply to by Marc Sabatella

In word processing, a non-breaking character is as you describe. But in LilyPond, which already has an established no-break functionality and is popular music notation software, a noBreak is exactly what I describe. What I describe therefore is indeed a no break. They define \noBreak as forbidding a break, which is very straightforward. LilyPond seems to agree with me that a forbid-break is a no-break.

To add to the flaws in the analogy, when I tried using a non-breaking character in LibreOffice Writer between two very long words, it didn't put in a line-break at the place of the non-breaking character, it put the line-break in the middle of the second word. This would be analogous to a no-break element forbidding a break, but then line-breaking half way through the bar after it, which honestly would be preferable because it would stop the bars jumping around while trying to make adjustments.

In reply to by to7m

I would guess at least 100 times as many people are familiar with word processors as with LilyPond, so I think it makes more sense to base naming on what's more familiar to more people. But in any case, what to call it is a minor point to be decided much later. First step is to start with that blank slate and design how the thing should actually work - how someone with no previous experience to bias them might expect to use the feature.

In reply to by to7m

If you have a score where you need to do this a lot, easiest is to go to Format / Style / Measures, then set Spacing to 1 and Minimum note distance to 0. This will allow things to be so tightly spaced that notes literally touch - you almost certainly would not want more measures per system than this. Now you can go through and just add the breaks where you want. Bonus, it actually results in somewhat better note spacing as well.

In reply to by Marc Sabatella

MuseScore is perhaps like a basic word processor but not like an advanced one. An advanced word processor will try to get balanced lines as much as possible, respecting the no break. So there is no "minimum" space between words, but a "desired" space between words. Some lines contain a bit more words than desired, some lines a bit less, all together to get a nicely balanced display.
My understanding is that MuseScore is much more basic and just try to put as much as possible by line respecting the minimum distances and that is all. There is space for improvement... (Pun intended :-) )

In reply to by frfancha

Late to the party, but I went here searching for a way to do that, and I eventually found it, so it might be useful to others. With MuseScore 3.6 (I don't know about previous versions), if the intended measures don't fit on the line, select them, and type { (or menu Format>Stretch>Decrease layout stretch) as many times as necessary to make them fit. This is far less efficient than what Lilypond does, but it works and is probably enough for many use cases, such as copying paper scores, where you want to have the same line-breaks as the original while copying. I use it also for making Jazz scores with 4 bars per line, which are easier to read (from the rhythm point of view), but might be a problem for lines with repeats and two endings, where you might have to fit six bars on the same line. But remember that, unlike with Lilypond, this is not dynamic. If you happen to change the music or the layout, or if you want to use normal stretch after copying a paper score, don't forget to Format>Stretch>Reset layout stretch.

In reply to by Pierre-Yves Saumont

Indeed, that's a way if you only need to do it once or twice. If you are regularly finding you need to do this for a given score, it's easier and more effective to simply reduce the staff size (Format / Page Settings) or overall measure spacing (Format / Style / Measure). For the case being described ibn the OP, that's definitely what I'm recommend - setting a sufficiently small staff size and/or measure spacing so that by default you always get enough measures on a system, then adding system breaks where needed to match the original.

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