musescore / MuseScore

MuseScore is an open source and free music notation software. For support, contribution, bug reports, visit MuseScore.org. Fork and make pull requests!
https://musescore.org
Other
11.92k stars 2.57k forks source link

Removing a Duplicate Time Signature Replaces All Rests with New Rests of Largest Possible Value #20812

Open mdeirossi opened 7 months ago

mdeirossi commented 7 months ago

Issue type

UX/Interaction bug (incorrect behaviour)

Bug description

This is a large problem when trying to connect up different parts of a score/arrangement, where 2 different sections have the same time signature, there is no way to delete the extraneous one without destroying all rest values.

Steps to reproduce

  1. In any score, create a 4/4 time signature, and create another 4/4 time signature in the measure after the first one.
  2. Place an eighth note at the beginning of a measure after your 2 time signatures (so the measure will consist of an eighth note, eighth rest, quarter rest, and half rest.
  3. Delete the second time signature, which should not change anything from 4/4 due to the first one already being there.
  4. Any rests will be converted to new rests with the largest possible value (in this case your measure will now have an eighth note, followed by a half rest, quarter rest, and eighth rest, which is clearly wrong).

This occurs using any time signature and with any distance between them as long as they are the same (actually it occurs if they are different as well but that is less of an issue since you are then changing the whole score when deleting one). All rests in the entire section after the deleted time signature will be affected, a nightmare for large scores when you don't see it happen for a while.

Screenshots/Screen recordings

image image

MuseScore Version

4.2, 3.6.2, likely all versions

Regression

No.

Operating system

Windows 10

Additional context

No response

RhinoHaggis commented 6 months ago

Deleting a duplicate tune signature also deletes Layout breaks that fell under that signature. If MuseScore is reprocessing time-sensitive markings on delete, it would be really nice if

  1. it checked first whether any timing change has actually occurred. And then
  2. IF a change has occurred, make changes to rests only when necessary.

the second rule would mean even if you deleted a non-redundant time signature, MuseScore would still preserve how rests are articulated everywhere except across new bar lines.

RhinoHaggis commented 6 months ago

Lastly, even when changes are necessary, it should fill in rests the same way it does when we enter notes in the first place. (Respecting the counts).

It seems to me rests should never be processed like in that second screen shot β€” and in fact never are arranged that way on note entry or ordinary editing, unless manually done by the user.

oMrSmith commented 6 months ago

It looks to me as if the rests get re-arranged in the inverted order. This is huge bug and I remember how I prevented this in MU3 by hiding duplicate time signature rather than deleting them.... PS: I noticed there's a tool to regroup rhythms, which can fix the problem afterwards.

sammik commented 6 months ago

I think, here are actually two different issues.

  1. st one is that one described - measures shouldn't be rewrited, if length of measure doesn't change (if changing 4/4 to 4/4, or 3/4 to 6/8, ...)
  2. nd one is how rests are written in rewrited measures. now (I think) logic is following: as larg rests as possible first. It means, if there were two eight notes in 3/4 measure and it changes to 6/8 one half rest will appear (which is incorrect in 6/8, it should be 8rest and 4. /or 4 and 8/ rest(s) )
RhinoHaggis commented 6 months ago

Yeah I think we all agree the current logic is backward. Can you read over these proposed changes to see if it seems best? Going case-by-case

  1. For duplicate signatures there should be NO CHANGE. Don't reprocess, even to the default "correct" order; preserve the rest structure exactly as it is. This is existing data; the default is not correct, the user is correct. (πŸ™ and maybe don't delete other time-dependent data the user does not associate with a particular instance of a time signature, like Layout breaks. πŸ™ )

  2. If a non-duplicate signature, preserve the rests whenever possible and only reprocess when forced by bar lines. (again, preserve the structure of the original as much as possible.)

  3. When -for whatever reason- rests must be rearranged (like before and after a barline) The current order is inverted, and an obvious bug. Notes should be arranged in the correct order (smallest first).

This addresses both issues in the way -I think- we want.

[Some things will still change on delete. Settings under "time signature properties" like how to group eighths, sixteenths... These are specific to an individual time signature]

sammik commented 6 months ago

Well, first case should be covered by #20825 Please, check that PR build to test it.

In theory, it may bring some issues, if there were diferent local time sig in other staves. But I hope, situation now is not worse, than was in master / 4.2.

MarcSabatella commented 6 months ago

I agree that when it's possible to preserve everything about a measure, it should be done 0 when changing form 4/4 to 4/4, for example. But changing form 4/4 to 2/2 should change beaming etc according.

And not sure what you mean by "Notes should be arranged in the correct order (smallest first)". There is no such "smallest first" rule in music notation. But following correct rules by default could be nice, to save the trouble of manually running Tools / Regroup rhythms.

RhinoHaggis commented 6 months ago

@MarcSabatella create a score in 4/4 and add a sixteenth note on the first beat. Musescore will always create a sixteenth rest following , and then an eighth, to get back to the count. Always. Although rests can be structured however we decide, it is standard practice to "square up" rests to the next longest value, so that you return as quickly as possible to the pulse.

For a single sixteenth on the beat, first fill in the "missing" sixteenth to reach the eighth note, then the "missing" eighth to get to the next count. I think that if you spend some time with it you can satisfy yourself this is a universal standard of practice across the centuries, and composers/engravers only break it in a way that hides the counts (like your second screen shot) if there is a musical purpose, for example if it reflects the rhythm being played on another instrument.

RhinoHaggis commented 6 months ago

@sammik Wait. the "measure of same length" is not the same question at all.

The idea of preserving order in scaled signatures sounds awesome, but it can't be done automatically, because the count structure may have changed. Although we can write whatever we want, by convention, 3/4 implies three counts to a measure and 6/8 implies two. The pulse changes from quarter to dotted quarter. If I start writing something in 3/4 and then decide to 6/8, that opens a question of what - exactly- I mean. Do I want to respect the original notation, or do I want to conform it to 6/8? A machine that pastes anything from 3/4 into "hemiola time" in 6/8 would be infuriating.

Perhaps a dialogue asking the user's intentions? something like, "Do you want to preserve your beaming/rest structure, or do you want me to conform to the prevailing beat?"

MarcSabatella commented 6 months ago

Oh, certainly, for that specific case, it does happen to be true that the shortest rest value comes first. but that’s not the actual rule - it has to do more with placement releative to the beat. Had the one note been on beat 4&, it would be exactly the opposite - the longest result would come first.

Anyhow, now I understand what you mean, and yes, obeying correct rules for rests when rewriting measures would be good indeed.

RhinoHaggis commented 6 months ago

ooooops sorry. Yeah sorry for the confusion. I guess my thinking has always been, the simplest case (one note) the short rest has to be next to the "intrusion". 'Always squaring off to return to the count' has the equivalent result (until you run into another pile of rests coming from the other way) of going short-to-long in both directions away from the note. I should have been the first to realize I hadn't actually thought through if any rules like this survive in a meaningful way for actual music. 😬 Screen Shot 2024-01-03 at 3 17 34 PM

DaddyLudwig commented 6 months ago

I agree that when it's possible to preserve everything about a measure, it should be done 0 when changing form 4/4 to 4/4, for example. But changing form 4/4 to 2/2 should change beaming etc according.

As far as I'm aware, beaming in 4/4 vs 2/2 should have 0 difference. I know that in simple meters, the general rhythmic parsing rule for beams is to group by the note value 2 levels larger than the shortest note while also keeping the beats clear. i.e. if the shortest note is a sixteenth, group by the quarter, if it's a 32nd, group by the eighth, etc. And both 4/4 and 2/2 are simple meters.

In fact, I posted an issue almost a year ago now about how 2/2 is beamed incorrectly when there's a composite rhythm of eighths and sixteenths. I have to use the Break Beam Left a lot to fix it so that it's parsed by the quarter note. https://github.com/musescore/MuseScore/issues/16384

And indeed, most editions I've seen of pieces that are both in 2/2 and use composite rhythms of eighths and sixteenths like say Bach's Brandenburg Concerto no. 3 First Movement, do beam the eighth sixteenth rhythms in the exact same way that they would be in 4/4, i.e. the beam is completely broken by the quarter note, no eighth beam across from the last subdivision of the first quarter to the first subdivision of the second quarter.

But in general, yes, I agree with what you and the other people here are saying about time signatures.

sammik commented 6 months ago
  1. I think, rest is not "missing music", rest is music. If MU doesn't rewrite rythmical structure of notes, why should it rewrite rythmical structure of rests? (Of course, starting of rest doesnt sond and starting of note sounds, but group of rests is similar to group of tied notes.)

  2. I think, if rythm should be rewrittern somehow, it should be consistent. I don't see any reason, why changing time signature by removing time signature gives different results than changing to identical one by inserting time signature. See: change-ts-inconsitencies

oMrSmith commented 6 months ago

One thought: I know another notation software, where it is impossible to "change" the time signature to the same time signature so maybe it should rather be an measure-specific option to "show courtesy time signature" anyhow...

RhinoHaggis commented 6 months ago

@sammik "I think rest is music". Yes. This is, --aside from the crazy way the rests were ordered-- the fundamental complaint. Existing data (including rests) should be respected by Musescore.

I'm backing off on my 3/4 to 6/8 concern. First I'd like Musescore to respect the user data when I delete a time signature. In-app I'm happy to deal with ambiguous conversions either in a separate place, or AFTER the reported bad behavior has been corrected.

@oMrSmith there are at least three reasons this "not allowed" idea is bad:

  1. Loss of functionality: Musescore attaches a number of properties to a time signature, like how to beam groups of notes. Say I have a piece with two different sections, with completely different beaming rules. But the time signature never changes. At present, (I believe) the only way to get the correct auto-beam behavior in both sections is to use duplicate (invisible) time signatures, one for each distinct section. These are not courtesy signatures. Each defines its own distinct behavior.
  2. Duplicate signatures occur all the time in real music. For example, in many songs with a recitative-like introduction, the change from intro to refrain (where the song actually gets started) is marked by a double bar and a re-assertion of the time signature.
  3. editing can't be stopped from creating duplicates: Like the OP I regularly arrange and edit scores, making cuts and other changes that result in duplicate time signatures. For example, when I remove an intervening section in a different time signature, to join up to alike sections. There are now two time signatures, and they are the same. THIS part is fine. It would be even worse if MuseScore did not recognize this as a valid state, either silently deleting one of the time signatures, or -worse- not recognizing the result as valid, and crashing.
DaddyLudwig commented 6 months ago

Minuet and Trio in classical music is another common instance of duplicate time signatures, like 3/4 will be stated for the Minuet and then again for the Trio. With a system break and a repeat sign and possibly a key signature change being all that separates the 2. In those instances, I insert a 3/4 time signature at the start of the Trio and then I make the courtesy 3/4 at the system break invisible to match what I see in the sheet music(and also to avoid accidental deletion of the time signature I just inserted).

sammik commented 6 months ago

Perhaps a dialogue asking the user's intentions? something like, "Do you want to preserve your beaming/rest structure, or do you want me to conform to the prevailing beat?"

There already is a tool axectly for this: Tools -> Regroup rhythms

sammik commented 6 months ago

One other inconsistency. If new time signature (of same measure duration) is inserted in place, where old one already is, measures are not rewrited. But if new one is placed on measure, where time signature is not, measures are rewritten.

https://github.com/musescore/MuseScore/assets/1646034/d914ad19-467b-4ea5-ac5f-c86ed81be898

(Missing eight note flag is reported as separate issue #20864)