Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: when changing a measure in simple meter written in triplets to its compound, rewrite by removing tuplets instead of reflowing music #24949

Open
4 tasks done
FrancRos31 opened this issue Sep 27, 2024 · 13 comments
Assignees
Labels
feature request Used to suggest improvements or new capabilities

Comments

@FrancRos31
Copy link

FrancRos31 commented Sep 27, 2024

Issue type

UX/Interaction bug (incorrect behaviour)

Description with steps to reproduce

  1. create a staff in a simple meter (4/4, 3/4, 2/4)
  2. add an 8th note triplet for every beat of a measure
  3. change the simple meter with its compound (4/4 = 12/8, 3/4 = 9/8, 2/4 = 6/8)
    Expected behaviour: nothing change except the numbers of the tuplet disappear.
    1

Actrual behaviour: a rest adds up to measure and you can't delete it.

Supporting files, videos and screenshots

2024-09-27.19-09-39_Trim.mp4

What is the latest version of MuseScore Studio where this issue is present?

OS: Windows 10 Version 2009 or later, Arch.: x86_64, MuseScore Studio version (64-bit): 4.4.2-242570931, revision: github-musescore-musescore-3130f97

Regression

I was unable to check

Operating system

Windows 10 Pro

Additional context

1
After conversion the real value is still 12/8, although there is a rest added.

Checklist

  • This report follows the guidelines for reporting bugs and issues
  • I have verified that this issue has not been logged before, by searching the issue tracker for similar issues
  • I have attached all requested files and information to this report
  • I have attempted to identify the root problem as concisely as possible, and have used minimal reproducible examples where possible
@cbjeukendrup cbjeukendrup added feature request Used to suggest improvements or new capabilities and removed UX/interaction labels Sep 27, 2024
@cbjeukendrup cbjeukendrup changed the title Changing a measure in simple meter written in triplets to its compound adds a rest you can't delete Feature request: when changing a measure in simple meter written in triplets to its compound, rewrite by removing tuplets instead of reflowing music Sep 27, 2024
@cbjeukendrup
Copy link
Contributor

The current behaviour is technically expected: the duration of the notes does not change, and the music is redistributed over the measures (which sometimes leads to the insertion of a rest, because otherwise the measure would be incomplete).

The behaviour you propose seems intuitive, and is likely to be the desired result in some cases; but there are some problems with it:

  • how to determine algorithmically when such behaviour should be applied, and when not?
  • what should happen when not all notes are triplets? Two eight notes could perhaps be rewritten as a duplet for example, and more complex rhythms can in theory of course also be put in tuplets to distribute them over the new measure length, but it is questionable if that will give good results.

An option would be 'trying to be clever': when music contains only triplets, then rewrite by removing the triplets, otherwise rewrite by 'reflowing'; but experience shows that 'trying to be clever' doesn't really work, because the guess will always be wrong in some cases, and it makes the app feel unpredictable.

@sammik
Copy link
Contributor

sammik commented Sep 28, 2024

I think, this is related: #23830

@FrancRos31
Copy link
Author

FrancRos31 commented Sep 28, 2024

how to determine algorithmically when such behaviour should be applied, and when not?

The algorithm should consider the beats of the selection you make:
if numberofbeats == 4 don't add rests or notes to the measure (4/4 = 12/8);
if numberofbeats == 3 don't add rests or notes to the measure (3/4 = 9/8);
if numberofbeats == 2 don't add rests or notes to the measure (2/4 = 6/8);
if numberofbeats == 1 don't add rests or notes to the measure (1/4 = 3/8);
the number of beats that the program has to keep in mind is decided by the meter the user drags from the palette
So, when the user drags the 12/8 meter in a 4/4 section or whatever: the algorithm counts the number of beats from the beginning till the next time signature or the end of the piece and converts tuplets by making disapppear the tuplet numbers and add tuplet numbers for duplets.

@FrancRos31
Copy link
Author

the duration of the notes does not change, and the music is redistributed over the measures (which sometimes leads to the insertion of a rest, because otherwise the measure would be incomplete)

So, is one measure not considered one measure in this case? Because the program adds a half note rest in a 12/8 measure because, as you said, the measure would be incomplete, but it is not.
1

The question showed up to me from a user thread in italian forum. He wanted to convert a section consisting of 4/4 measures written in two quarter note triplets. He wanted to convert this 4/4 section in a 6/8 section (which is theorycally simple to do). Now, I resolved the problem with a workaround (I pasted the triplets in half duration and made invisible what wasn't needed), but I thought this feature would have its relevance for something like this.

I investigated further in the problem and check this

1.mp4

I tought something very stupid but who knows: we could use the time signature as a signal to the program to say to him "this is a measure (or a multiple of one measure), in this space between the two time signature don't add anything" and if the user doesn't use the target time signature the program will show a message to the user: "can't do it beacuse there's no target sign". Obviously the user can't put the target time signature in the middle of the measure, it has to be before a barline. Or you could create some time of new signal. My opinion, of course.

@FrancRos31
Copy link
Author

I think, this is related: #23830

This issue is asking for a very huge feature, but I agree with @wizofaus, this can be a very nice feature. Feel free to close this, I'll move my messages in the other issue.

@sammik
Copy link
Contributor

sammik commented Sep 28, 2024

I think, confusion here comes from this.
There are two ways of understanding rythmical structure.

1. absolute duration first

  • it means, eight note = eight note
    doesnt metter, which time you have (and triplet remains triplet, ...)

2. beats first

  • it means, beat = beat
    in 4/4 bar, one beat is one quater note
    but in 12/8 measure, one beat is doted quater note
    so triplet of eights in 4/4 = 3 simple eights in 12/8
    2-4=6-8

but other examples could come
Alla breve (2/2) has two beats (two half notes), so copying from alla breve to 4/4 works as "paste half duration" (because one beat in alla breve is half note, but one beat in 4/4 is quater)
2-4=2-2

This is still simple.

But now, we have 5/8. What is it? Two beats 3+2, or two beats 2+3, or 5 beats, or one beat, or 2+1+2? How could we know? OK, we can look at beam groups. But are theese beats equal? No, they are not. So how to reinterpret them into equal beats?

Lets say, we have 2 beats (3+2), and want to paste into 2/4. Should it be triplet + two normal eights? Could be, but music changed (eights are not eqal, but beats became equal)
Beats_first

And so on...

So, I am not telling, it is impossible, but personaly, I would prefer no. 1 "preserve rythmical proportions of source notes" and enhance "paste half/double duration dialog" which would have option to be able set almost any ratio .

@cbjeukendrup
Copy link
Contributor

if numberofbeats == 4 don't add rests or notes to the measure (4/4 = 12/8);

In practice, musically often yes; but mathematically no: 4/4 = 8/8 and 6/4 = 12/8. So if you put 4 triplets that have a duration of a quarter each, you have only four quarters or eight eighths, so the remaining four eighths in a 12/8 bar will have to be filled with a half rest.

That is to help you understand why MuseScore does what it is doing, and in what way that can be considered correct. So the behaviour is completely logical, but there is of course a difference between logical and intuitive.

In simple cases where you have a 4/4 measure consisting of only triplets, it may indeed feel more intuitive to scale the duration of a beat from a quarter to a dotted quarter (which would make the tuplet ratio 3:3, after which it would be a logical thing to do to extract the eight notes from the tuplet, removing the tuplet).

But, as pointed out by me and Sammik, the problem is that this scaling logic is almost impossible to generalise to all possible situations; any attempt at a generalisation would require making bold assumptions, which is not a good idea.

So the only somewhat sensible thing we could do, is making exceptions for 4/4 -> 12/8, 3/4 -> 9/8, 2/4 -> 6/8 changes. But "making exceptions" is of course only a last resort, because it is equivalent to "introducing inconsistency".

@cbjeukendrup
Copy link
Contributor

Also, your workaround is not really valid: it modifies the length of the bar to contain actually only 8/8 instead of 12/8, because each triplet has an actual length of two eighths (and into those two eights, three eights are put). This will become apparent as soon as you start entering non-triplet notes on a second staff/voice in that same measure.

(Finally, to be clear, it's not that we don't see the problem, or that we don't see that the problem is annoying and maybe even confusing, but I rather wanted to try to make clear what's going on, to make clear that the problem is not straight-forward to solve, even conceptually. Here's another image that might help with that:
Scherm­afbeelding 2024-09-29 om 00 23 21
)

@wizofaus
Copy link
Contributor

I don't see why you need special cases at all - the facility to change time signature but preserve the existing measure boundaries seems like something that could be done with a general purpose algorithm that would only need to recognise the difference between compound and simple meters. 5/8 to 2/4 would just require using a 5:4 tuplet. If a measure already contains m:n tuplets and the new measure length is n/m of the existing length then the tuplets logically become 1:1 and get just converted to standard notes.
Some conversions e.g. 12/8 to 3/4 might produce some unexpected results - all note durations would need to be halved, but in some cases a 4:3 tuplet might more appropriate.

However I wouldn't suggest this should be the default behaviour, but similar to using ctrl to add a local time signature, maybe using alt to add a time signature and rewrite durations (so that notes remain within existing measures) would work...

@cbjeukendrup
Copy link
Contributor

Simply offering both options is probably the best thing we can do indeed. The "rewrite by scaling" option will be useful in a limited number of cases, so not making it the default would be good.
Instead of using yet another (difficult-to-discover) modifier key for this, we could consider an interaction similar to what you get when pasting something in MS Word: as soon as you paste something, a small, non-disruptive but unmissable popup appears, which lets you choose between different variants of the paste comment, letting you quickly switch between those variants retroactively, until you perform some other action.

@avvvvve This may be a good addition to your list of time signatures issues to think about. It's a bit of a long read though, apologies for that :)

@wizofaus
Copy link
Contributor

The way I normally add time signatures is to select a whole measure (or range of measures) and just click on the palette option.
But you could have some extra text in the tool tip that appears that explains the modifier key options.
I would think you should then be able to support adding a local time signature to a staff with existing notes and have it rewrite them accordingly (though I don't know why it doesn't allow adding a local time signature and just adjusting which notes belong to which measures the way it does when you add a regular time signature).

BTW the one time I'd definitely want to be able to change a time signature while preserving the existing measure boundaries (i.e. which notes are in which measures) is when the measures are completely empty - the current behaviour currently feels a bit unexpected, if, for instance, I have, in 4/4, two empty measures followed by other measures containing notes, then I decide the two empty measures should be actually be 3/4 instead, if I select them and then choose 3/4 from the palette, it actually creates an extra measure, presumably to allow for the fact that there were originally 8 1/4 notes worth of rests (but now there are 9!).
I think I also discovered a weird bug after doing that, undoing then applying the same time signature again, will report once I've worked out what's going on.

@FrancRos31
Copy link
Author

FrancRos31 commented Sep 29, 2024

So if you put 4 triplets that have a duration of a quarter each, you have only four quarters or eight eighths, so the remaining four eighths in a 12/8 bar will have to be filled with a half rest.

Ok, now I totally understand. No one can't forbid you to add 8th note triplets in a 12/8, and to make this possible, a 8th note triplet has to be necessarily equal to a quarter note both in a 4/4 and in a 12/8. I'm sorry for the confusion but adding 8th note triplets to a 12/8 is not something I see everyday (it's more logical to change the 12/8 in a 6/4). What I requested doesn't keep in mind the absolute value of a 8th note triplet and is against maths, and I understand that from a programmer POV trying to implement this would mean forcing the program to go against the mathematical theory at the base of music, remembering that from a musician POV, a 4/4 measure written in 8th note triplets and a 12/8 measure written in 8th notes are undiscernible. The confusion came because I always thought about this like a musician and not like a mathematician (and sometimes repertoire doesn't help, look at some Verdi operas, they are full of simple meter written in triplets)
2

your workaround is not really valid: it modifies the length of the bar to contain actually only 8/8 instead of 12/8

Actually, I didn't change the measure value, I only made invisible the rest at the end of it and the tuplets' number.
3

So, I am not telling, it is impossible, but personaly, I would prefer no. 1 "preserve rythmical proportions of source notes" and enhance "paste half/double duration dialog" which would have option to be able set almost any ratio .

I agree with this, if what I proposed will make more harm than good.

@wizofaus
Copy link
Contributor

One thing I would think the proposal here will struggle with is if the existing score contains several existing time signature changes and you want to apply to same transformation to all of them, e.g. 4/4 measures to 12/8, 3/4 measures to 9/8 etc. And if you do select both a 4/4 and 3/4 measure and try to convert them to 12/8 while preserving barline positions, what should happen?

@avvvvve avvvvve self-assigned this Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Used to suggest improvements or new capabilities
Projects
None yet
Development

No branches or pull requests

6 participants