Align flags between voices when using "x".

• Aug 21, 2018 - 19:57

Something that would be useful to me is:

when I am using 2 (or more) voices in a chord and I wish to have them share the same stem and flag I would like to see them automatically appear as a single chord.

For example, I have a push into the next bar that requires me to use more than one voice as there is voice movement that varies in the next bar. Both voice push into the bar, using the same rhythm.

I set up the 2nd voice in the push bar, delete the extraneous rest(s) and tie roth voices into the next bar. I then select the 2nd voice note and press "x."

At that point I now have a single staff but with 2 flags, improperly suggesting that the rhythm is halved.

I would like to see the program automatically either remove the extraneous flag(s) or automatically increase the length of the stem so they are superimposed.

Great work folks, thanks,

Regards,

At that point I have 2 stems, each with


Comments

Interesting, seems to only happen for upstem notes - if both noes are downstem, the flags merge. Probably a glitch in the stem length calculation based on the fact that the notehead isn't symmetric. But for me, the flag goes away as soon as I press Shift+X, which I would also need to do in order to see only a single head. Is it different for you? Can you attach a score?

Anyhow, FWIW, I wouldn't recommend using this technique in the first place. If you have two notes you want to appear as one, instead of depending on them overlapping, better to make one invisible.

In reply to by xavierjazz

Do you mean the piano RH part? Oh, I see, you aren't talking about a unison chord (same not in both voices) but instead a case where you are trying to make two different notes in different voices look like the same voice. Here, I would say you are better off keeping it as you have it - it can be a bit confusing to have notes in different voices tied together. But if you really want that look, no need to fake it using separate voices in bar 60. Just enter the chord in one voice normally. You'll still be able to tie the notes to different voices in bar 61; you may just need to flip the tie direction.

Anyhow, the reason we don't lie about stem lengths and try to make two separate voices look like one is that, depending on your reason for flipping stems, it may be exactly the opposite of what is intended. So here again, if you really want to enter as two separate voices but then make it look like one, the way to do that would be to hide the flag - but that's not really the best way to handle this situation. Better to actually keep it as separate voices and not try to hide that fact, or to actually enter it as one voice for real.

Not sure what accent you are referring, but do note that the rules for positioning of articulatiosn different for single-voice for multi-voice situations.

In reply to by xavierjazz

If you mean on the same note as the mordent I would be very glad MuseScore didn't hide it under the mordent. Most scores I've seen would put the one on the first beat under the staff also.

In reply to by xavierjazz

That's interesting. It looks like it's making room for the obscured staccato and the mordent. As I remember, in the past the staccato and sforzato would always move together. Select select the staccato and press X and both move. Doing this with the sforzato doesn't do anything except change the inspector. As far as I remember Mordents always went above the staff.

I'm doing more tests as I write this and I've found that adding a mordent (or one of its relatives) disconnects the staccato from the sforzato so they move independently. If you delete the mordent from the score you posted you will see the results of this.

I would be interested if Gould covers this at all or if it's a bug.

In reply to by mike320

MuseScore places single articulations according to fairly standard rules. When multiple articulations are on the same note, things get more complicated. Basically, we special-case a few of the most common situations to make sure they do things that subjectively seem like good things to do, but if it's not one of those special cases, they just stack.

In reply to by Marc Sabatella

This situation is handled wrong by MuseScore. It gets complicated is a cop out. As far as I've seen, articulations (which do not include turns, trills and mordents) stay together in scores. You never have a staccato above and sfortazo below a note. That's why I asked if Gould made some sort of confusing exception to this.

In reply to by mike320

I guess it would help if you picked one specific case you think is handled incorrectly. I exlained how the algorithm works; it's going to do the right thing for single articulations and for those special cases we had the foresight to program in specially; Tlthe rest will just do default things. So if you want some specific combination to not do the default thing but instead do some special thing you think will better, it needs to be added to the special cases.

In reply to by Marc Sabatella

You apparently didn't read the previous posts where the staccato is above the note hidden by the mordent and the sforzato is far below the same note in measure 60. This is what I was talking about not being correct and wondered if there was some weird exception included in Gould.

In reply to by mike320

I saw the posts but there was reference to several different cases, and as I said, each specific case is handled differently, plus there was the question of multiple voices or not, which changes everything. So it was hard to keep track of.

Anyhow, in cases where there are three or more articulations and two of them are staccato and sforzato and multiple voices are involved, it does indeed seem the special case code is backfiring on us. Other combinations of three or more aritculations work better, but here, it seems the sforzato is trying to allocate room for the staccato but the staccato is actually on the other side.

In general, though, in cases of multiple articulations, it's going to be expected they will overlap and you'll need to do some manual adjustment. We only do special-casing to create good default layout for certain combinations. But indeed, ideally it should be just a matter of them overlapping. The gap shown here does constitute a bug.

In reply to by Marc Sabatella

Turns (generalized term for all of those wavy things and trills) are always above the staff unless there is a divisi situation (like with violins) then they are on the top or bottom depending on where it's attached note is. The others accents I've always seen either above or below the note depending on the editor. I've NEVER seen a staccato and sforzato attached to a single note on opposite sides of the note until the post in question.

The spacing could be related to the notes in voice two that starts on the 4th upbeat, but I seriously doubt it. If you don't have a turn, the accents stay together and move according to some mysterious rule I have yet to totally figure out. If you add a turn, the sforzato moves to make room for something and becomes independent of the staccato. I didn't test every combination of accents, but I'm sure it's related to the turn not the voice. I tested it in measures with a single voice with the same results.

In short, turns are independent of the other articulations and ornaments and with the exception of possibly needing to move them from overlapping something else, should have no effect on the other accents.

In reply to by mike320

I think the bug is that the special-case code for the staccato/sforzato combination is only half-working in the case where there are also more articulations. It's working enough to move the sforzato but not enough to get the staccato on the same side. So indeed, a special case not currently handled correctly.

But to be sure - the notes in voice 2 are relevant. As I said, the rule differs according to the presence of multiple voices. With only a single voice, the staccato does go below - but it's still the case we seem to allocate too much space if there is a third articulation. My guess is the algorithm actually should be placing the sforzato above in this special case..

In reply to by Marc Sabatella

The voice 2 notes are not relevant. Follow these procedures:

Create a note in a measure with one voice and add both a staccato and sforzato.
Select the staccato only and press x - both accents move as expected
Return the accents back to their original positions with undo (this will prevent them from moving independently until later).
Add a trill or mordent to it - notice the staccato and sforzato move away from the notehead.
Select only the staccato and press x - only the staccato moves.

In another measure enter a note with both a staccato and sforzato.
Select the sforzato and press x - nothing happens
Add a mordent to the note - the sforzato moves to the other side of the note and the staccato stays.

This is the root problem. There are no voices involved in this and shows what is happening in the OP's measure 60.

In reply to by mike320

They are relevant in that they change the results. Just try it yourself - the results do change when you add the second voice. The results are not "correct" in either case, but the results do change. Just take your example above and then add a rest in voice 2 and you will see the staccato flip. It's not a big deal, but I do like to be accurate, and to provide necessary information in order for people (me, you, other people who might want to try to fix this) to understand as much as possible about the situation.

In reply to by Marc Sabatella

The only effect I see the second voice has is which way the stem is pointed if the note is on the middle line or below. If you add an invisible second voice the accents move *as expected if the stem direction flips. If the second voice is not invisible the stem direction is up and the accents act accordingly.

*as expected: according to MuseScore's rules if default direction and anchor are used, or according to any overrides you make.

You will need to explain like I did how adding anything to voice 2 changes this.

In reply to by mike320

Hopefully this picture explains clearly enough how the presence of a second voice changes the behavior of the algorithm:

three-articulations.png

See how that rest in voice 2 changes the position of the staccato, without adjusting the position of the sforzato, making a moderately-bad situation worse? With only a single voice, at least the staccato and accent are on the same side, and the extra distance to the accent is only somewhat bothersome. But as soon as the second voice is added, the staccato flips above the note, thus making the spacing more awkward, and putting the staccato and sforzato on opposite sides as well. And this is exactly what the original score was showing.

So there are two different code paths that need to be looked at here in order to fix the bug. If one were to only address the single-voice case, it would almost certainly not fix the multi-vocie case, which as you can see is handled differently. Thus, multiple voices are relevant to understanding and fixing the problem.

In reply to by Marc Sabatella

FWIW, the spacing issue in the multi-voice case is more pronounced (in both cases) if I use a D below the staff instead of the A:

three-articulations-d2.png

Current builds of master handle this differently, producing arguably better results with respect to spacing (too cramped in the single-voice case, I'd say), but it still has the questionable positioning of the staccato and sforzato on opposite sides in the multi-voice case:

three-articulations-d3.png

In reply to by Marc Sabatella

I see the difference. You are deleting the unneeded rests in voice 2 rather than making them invisible. Deleting the voice 2 rests makes different result.

I would suggest that whatever happens to the staccato and sforzato when the turn is added needs to not happen so they continue to move together. The extra space between the note and accents may or may not make sense in some situations.

I just tested with a sforzato, staccato and a tenuto and saw that the third item once again caused the accents to separate - that is they become independent. I don't think this should be the case.

Here is my suggestion, multiple items with the same default anchor should always be treated as a single item with stacking according to some reasonable algorithm. For example, make them in some order like this when they are above the staff

Trill
Prall
Marcato
Sforzato
Tenuto
Staccato

Insert other items in reasonable places to include the various turns in case someone decides for some reason to add both a trill and a prall to a note with the above staff anchor or change staccato to above staff anchor. I realize by default all these items do not have the same anchor, but the user can change this. Creating a lookup table that includes default spacing for these should not be a problem if it doesn't already exist. By default spacing I mean a spacing so that when you add the space above a staccato to the space below a sforzato it is correct. You may need to special case items like a staccato and tenuto since that is the same as a portato.

In version 3 (which is the only place this fix will likely be seen) the auto avoidance can use this table and the anchor position to decide the order of items added to a note. For example, anything with the anchor "Above Staff" will always be over "Above Chord."

These are just some thoughts that came to my mind that someone might consider when fixing this issue.

In reply to by mike320

One small clarification - deleting the voice 2 rests doesn't change anything in 2.3.2, but it does indeed in master.

As I have said, we already do some special-casing to handle certain combinations of articulations in reasonable ways. Mostly, it is combinations of exactly two that get this special treatment. Anything that deviates from these special cases though, in theory just reverts to a default placement. What this disucssion shows is that apparently there are cases like this where something else odd is happening - it appears that the staccato-sforzato special handling is being "partially" executed, leading to worse results that if that special handling didn't exist at all. More investigation would be needed, but indeed, it should be focused on master.

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