Enforce no linebreak between measures
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...
Comments
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 I would use the # of measures 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.
In reply to I tried your suggestion of by MikeN
There is no other solution than reducing stretch. Except reducing the overall spacing, which results in a smaller score.
In reply to I tried your suggestion of by MikeN
You might want to look at Layout>page>scaling. Slowely reduce the scaling and see if that helps.
In reply to I tried your suggestion of by MikeN
Thanks, jojo and xavi. It was great that you replied so quickly. I'll soldier on. I'll try the global scaling as you suggest, and maybe I'll get lucky. Ciao, MikeN
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 I know this is 6 years on… by to7m
MuseScore once had a NOBREAK, actually it still has in the code, but it got disabled (or removed from the palette).
In reply to MuseScore once had a NOBREAK… by Jojo-Schmitz
Interesting, I never saw it. I'm guessing if it was disabled, it would be because of the added complexity given the interactions between various spacing considerations?
In reply to Interesting, I never saw it… by to7m
It got added in ab1723f, not sure excatly when and why it got disabled, IIRC it never made it into any released version
In reply to It got added in musescore… by Jojo-Schmitz
I believe it will be (partially?) reinstated with the changes from Isaac for multimeasure repeats in MS4.
In reply to I believe it will be … by jeetee
Ah, yes, I remember to have seen it there
In reply to It got added in musescore… 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 It was disabled because it… by Marc Sabatella
Maybe the existing “no break” element should be renamed to avoid confusion, and to leave terms available for true “no line break” and “no page break” elements. Maybe something like “hint avoid line break” or “raise same line priority”.
In reply to Maybe the existing “no break… by to7m
No break seems aptly named to me though, It's exactly what it does: do not break the line here.
In reply to No break seems aptly named… by jeetee
That's not what it does though. It only prefers not to break the line, but it still will break the line under most circumstances where it would be tried. This is more of a “loosely clump bars” option.
In reply to That's not what it does… by to7m
How do you come to this conclusion?
Have you tried Isaac's builds and found that this doesn't work as intended there?
In reply to How do you come to this… by jeetee
I'm not saying it doesn't work as intended, just that the intended behaviour is not a true “no break”. I haven't tried it, so I'm assuming Marc when saying that it doesn't prevent line breaks.
In reply to I'm not saying it doesn't… by to7m
So if you read his reply it actually is a true no-break between those measures where applied.
What it isn't (and thus also isn't called) is a no-break-and-also-squeeze-the-measures-if-possible.
In reply to So if you read his reply it… 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 “All it does is request two… by to7m
But if they contain too many notes to both fit on a single line using the current stave spacing and page margins, just setting "do not break" and wishing them to fit will not make them fit
In reply to That's not what it does… 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 That seems wrong. How can a… 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 Maybe this is just because I… 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 And to be clear, this is… by Marc Sabatella
For clarity, say you have 2 bars in the whole piece. Each of these bars contains a lot of notes, and MuseScore therefore separates them into different lines. Would the current “no break” force them together?
In reply to For clarity, say you have 2… 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 That seems wrong. How can a… by SteveBlower
No break, means no break here. Measures 6 & 7 will remain on the same system the breaks will only happen before 6 or after 7 not between 6 & 7.
In reply to No break, means no break… by mike320
According to Marc's description, the current “no break” would indeed still allow the system to break in some cases.
In reply to According to Marc's… by to7m
Just not at the place where that nobreak git applied
In reply to According to Marc's… by to7m
Of course, just like a non-breaking space does. Just not right there. It will break before the whole group in order to keep the group together, just like what a word processor does. Just not the feature you are looking for here.
In reply to According to Marc's… 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 If it's impossible to keep… by mike320
That exactly might well have been the reason why it never got enabled in a published MuseScore version
In reply to If it's impossible to keep… 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 I'm sure there is some use… 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 I'm sure there is some use… 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 The use case for which this… 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 I get the analogy and the… 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 Again, I agree someday it… 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 In word processing, a non… 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 No break seems aptly named… by jeetee
[duplicate]
In reply to It was disabled because it… by Marc Sabatella
Another thing that would complete the feature set: A combined line-break no-page-break element.
In reply to I know this is 6 years on… 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 If you have a score where… 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 MuseScore is perhaps like a… 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 Late to the party, but I… 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.