Ability to control vertical preferences of autoplacement

• May 18, 2019 - 06:51

Is there a way to tell the autoplacement algorithm to do things like the following, without disabling it altogether?

  • Place segnos above rehearsal marks
  • Place chord symbols above repeat text right (when above staff)
  • Place tempo marks above rehearsal marks

I noticed there's a parameter called "stacking order" but all investigation points to this controlling a given element's z-index.


There is currently no way to change the defaults away from the engraving standards, but in current nightly builds, you no longer need to disable autoplace to override this. You can simply move the repeat up and then the rehearsal mark down.

No. The order (from top to bottom of the score) is hard coded into the algorithm. The stacking order shows which will be drawn first if they end up crashing.

Version 3.1 will make this much easier and you can even try it out using the beta mentioned at https://musescore.org/en/3.1beta. I use it for everything now except for helping people in the forums.

In reply to by Jer Roque

Is there a reason to deviate from the standard here? Might be better to just stick with it. But if you do have some special reason to need to do so, maybe easiest would be to define a style that uses a larger offset the elements you want further from the staff than the standards call for, so they get placed far away by default, then you only need to move the elements you want closer. I guess it depends on your specific reasons for wanting to do this.

In reply to by Marc Sabatella

Hi Marc,

Yes, the reason to deviate from the standard is because there are cases where when allowing autoplacement to do its thing, the end result is space inefficient and not visually appealing.

I've attached a MSCZ that was created with one of the more recent nightly builds displaying some of these use cases, and pictures of published works by Alfred and Hal Leonard that handle these cases in a more pleasing manner. Please take a look when you have a chance.

In reply to by Jer Roque

Thanks for the examples. Indeed, while there are standards for how these symbols should work, there are occasions where due to the specifics of the situation it can make sense to violate those rules here and there. That's why we prove the ability to adjust things manually. It's less clear why there would be a need to break the rules as a rule. All of the examples you show can be reproduced if desired using manual adjustment, although personally I disagree with the decision made by the editors in some of those cases.

Also, please realize that autoplace isn't trying to be space efficient, just to avoid collisions. In most cases, the way to be more space efficient is simply to choose which marking you want move left or right and do so - without disabling autoplace. Everything falls into place automatically as soon as there is room. Ctrl+Left/Right are great for this. So for example, in your score, moving the tempo markings left a few notches, move rehearsal mark "C" right a notch, and the DS left a notch, and everything falls into place.

BTW, if you know you are going to have chord symbols in your score, having the rehearsal marks set to to be right aligned rather than centered is supposed to avoid those collisions automatically by default. The jazz templates do this. Unfortunately there is a bug in 3.0 where that isn't working correctly - see #287723: Right-aligned rehearsal marks should align to barline. I have a pending fix for that. Meanwhile, you manually move the rehearsal marks left for any rehearsal marks you have mid-system. Probably best to set them to center so that adjustment doesn't get invalidated when the fix shows up.

In reply to by Marc Sabatella

Yes, it's acknowledged that everything falls into place manually as soon as there is room. The reason for the request is because many of the exact same manual adjustments are made over and over again, with regards to these edge cases. If they are able to be done algorithmically, then it both greatly reduces the amount of work that needs to be done as well as ensures consistent behavior across multiple sheets.

Ctrl + Left / Right works, but sometimes to get the the best alignment, it requires manually typing in offsets in the inspector to ensure consistency. Furthermore, it's unclear how much the collision detection algorithm is going to change in the near future as it's brand new, so we're trying to work with it rather than fight it, knowing full well that any adjustments in the algorithm could affect manual adjustments in a negative way.

I look forward to that bugfix, as all my sheets have chord symbols in them.

In reply to by Jer Roque

I agree having the algorithm provide optimum defaults is ideal, but I'd still disagree that placing things in the wrong order vertically by default is an improvement. It's really a step in the wrong direction to me. I'd rather see autoplace detect opportunities to resolve collisions the right way - using horizontal adjustments - not by putting the elements in the wrong order by default. Changing the defaults to be "wrong" means your scores are guaranteed to be wrong any time there is a collision, and it in no way prevents the possibility that there will continue to be spots that are space-inefficient and wrong, then you'll have to fix them manually to be space-efficient but still wrong.

That said, I'm not opposed to seeing controls over the default vertical ordering provided, just pointing out that it really is not* the right way to solve this particular problem.

In reply to by Marc Sabatella

What are you using as a reference for the "standard" so I can understand where you are coming from?

In the case of nudging the segno to the left so that the rehearsal mark can be closer to the staff, the segno's vertical placement looks a bit off / not aligned very well.

In the case of making room for tempo text, it forces it to be closer to the staff, even below chord symbols. Unless I'm terribly mistaken or all my sheet music is wrong, tempo text takes vertical priority over rehearsal marks & chord symbols.

Where would you put segnos at a rehearsal mark mid-system?

But yeah, if that sort of thing can be parameterized and user-configured, I think that would be pretty well received.

Attachment Size
Segno nudged to left.png 22.05 KB
Tempo marking is too low.png 28.73 KB

In reply to by Jer Roque

The standard modern reference for such matters is Elaine Gould's "Behind Bars". Before this, there were a number of others whose works helped shape the standard, including Garnder Read and Kurt Stone.

The usual rule is that rehearsal marks go either to the left of or above tempo markings. Tempo markings generally go over chord symbols, and this is what MuseScore does by default. But you are the one who mentioned you wanted to save space, so that's why I suggested moving it over to the left. Placing it below the chord symbol won't help save space, and it will be, again, objectively wrong. if you want to to move it to the left but still have it a bit higher, you are welcome to set the default height of tempo marking accordingly in the style settings - still no need to change anything about the default order of things (tempo marking never go under chord symbols). The usual rule is chord symbols lowest, then tempo, then rehearsal marks - but one of more are often moved horizontally to avoid the need to stack all three. Still, within whatever stack does exist, that's the correct order - chord symbol lowest, rehearsal mark higherst.

BTW, with respect to your examples, it's important to realize that what you are showing are not the usual MuseScore defaults, because you are using one of the jazz templates apparently. Things are done differently in jazz specifically because of the issue of chord symbols. It means rehearsal marks that are otherwise universally placed directly over the barline, or after the system header, get moved further left. In the case of start of system, they are moved all the way to the margin specifically because that is a common convention used in fakebooks such as the Real Book (for which I worked as an editor, BTW, so I'm quite familiar with the rules used). Moving the segno left is indeed how it is done there. Depending on the context, the segno might be at the same height as the rehearsal mark, or it might be lower. Consideration would include things like, is the rehearsal mark higher than t otherwise would be to avoid a chord symbol, since there might not be room here to move the rehearsal mark left as well.

In reply to by Marc Sabatella

So can you tell me where exactly these rules are stated or used? Some real world examples?

I haven't found anything in there with regards to rehearsal mark placement and segnos relative to each other in Behind Bars. Every example I find in my several bookshelf music collection has segnos directly above rehearsal marks when mid-system, aligned above the barline to clearly illustrate which bar the rehearsal mark + segno apply to.

Behind Bars also has absolutely nothing about chord symbols in the Pop/Rock/Jazz style.

I never said anything about putting tempo markings under chord symbols, mind you.

If things are done differently in the jazz templates that come with MuseScore, shouldn't the autocomplete algorithm account for things that are different as well?

I think it would be wonderful if there was some sort of configurable list where the user could control the vertical order, and there could be several "default lists" depending on stylistic preference.

In reply to by Jer Roque

Ultimately, yes, the ability to configure custom order would be nice, and I hope to see it added some day.

But FWIW, the current order is far from arbitrary, it was the result of some pretty thorough research on the part of several of us during the beta period last fall. We did manage to find good supportive examples for pretty much every decision we made - mostly from Gould, but some from other sources, and some just by studying scores from a variety of publishers in different genres. I should mention I've also worked professionally as an editor for a very popular series of jazz fakebook from a major publisher, so I did come into this with some pretty good experience, even if it is specific to that one context.

Here is the relevant change that completed this work, with a listing of all elements and their layout order, plus some images:


See also the discussions leading to this, in particular #279391: Text will not go underneath volta but also #278153: Continuous View: Volta changes Tempo of Playback.

If there are still specific elements you feel should be in a different default placement, feel free to show supporting evidence, and then we can show you ours :-) I'll try to address the specifics you raised here:

For repeat markings (segnos) vs rehearsal marks, this is an area where we needed to do some comparison and some logical deductions. Gould indeed doesn't give a specific example there, but does talk about the relative position of these to tempo markings, and it's clear in several places that she wants the tempo marking above all else except rehearsal marks (see p. 182, 485, 520), so that's kind of what we went on. That plus some examples that did have rehearsal marks above repeat markings. But to be sure examples do exist the other way. Mostly, as you allude to, things are organized so you don't need to make this choice because the elements clear each other horizontally. But knowing tempo goes above repeats, and rehearsal marks go above tempo, kind of settles it.

Regarding tempo text and chord symbols, you wrote: "Unless I'm terribly mistaken or all my sheet music is wrong, tempo text takes vertical priority over rehearsal marks & chord symbols". I wasn't sure what "vertical priority" meant in this context - above? below? - but I kind of assumed you were saying you disapproved of our ordering. And I guess it's still not clear if you are or not.

As for the templates, the way things are implemented, the ordering is fixed - the template can't change that. But it can try to set default positions that avoid the need for autoplace move things at all. That's what we do with rehearsal marks, chord symbols, and voltas in the jazz templates, to try to keep them out of each other's way as much as possible so you don't end up with them stacked vertically most of time.

In reply to by Marc Sabatella

Hi Mark,

Gould does state that rehearsal marks should go over tempo markings, but she does also state on p.486 "Where vertical space is limited or where it is more convenient, the rehearsal mark may go below the tempo indication:"

That said, as you know different publishers have different guidelines. Here are some examples from Alfred & Hal Leonard of rehearsal marks underneath segnos and tempo text. I am unable to find any examples within my physical collection of rehearsal marks above segnos and tempo text. Then again, I don't have a lot of Faber, so my collection is mainly classical piano (which doesn't use segnos much), musicals, & pop/rock.

In these examples, you can see segnos, to codas, and codas above rehearsal marks (with segnos neatly centered above them), tempo text above rehearsal marks & chord symbols, and even a rehearsal mark underneath a volta.

I'm confident that you can find plenty of counterexamples. The point is not that one placement is right while others are wrong, but rather that different engravers have different preferences, and one of MuseScore 3's best and most useful features enforces its own standards making it challenging for lots of engravers to get the scores to look the way they want them to look. As someone who grew up playing publications from Dover, Schirmer, Hal Leonard, Warner Bros., and Alfred, it's only natural that I'm going to want my sheets to look like some variant of those.

As a professional software engineer (Java, Kotlin, Web) who's worked for multiple large tech corporations whose products are used by the general public by millions of people, and after having worked with numerous product designers & user experience engineers, it's really surprising to me that decisions like these are hard coded and unchangeable within the software. For my team and I to get our scores to look the way we want them to, we have to disable autoplacement, which is a pity. We'd rather work with it and take advantage of its benefits. To do that, we need it to at least be able to work with our preferences rather than fight them.

In reply to by Jer Roque

Yes, Gould says the rehearsal mark may go under the tempo in those special cases. And we allow that, just not by default. There can be no question our default here is correct. Someday, as I said, we may provide the ability to customize the default, but for now you will just have to live with one extra click per score.

Since you say you are a developer, feel free to contribute your talents here and "scratch your own itch" as we say in the open source world! The code I linked to above was written by just such a first-time contributor! But I should warn you there are complications; in some cases there are interdependencies that require a oartocar order. Generally not so for text though.

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