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

[MU4] Fix GH#8893: allow for 128th as the denominator for measures, prevent crash on shorter ones #8894

Merged
merged 4 commits into from Oct 28, 2021

Conversation

Jojo-Schmitz
Copy link
Contributor

@Jojo-Schmitz Jojo-Schmitz commented Aug 20, 2021

Partly resolves #8893

The same fixes apply to 3.x too BTW.

@Jojo-Schmitz Jojo-Schmitz force-pushed the denominator branch 2 times, most recently from 52f7724 to 388f0c3 Compare August 20, 2021 19:13
@Jojo-Schmitz Jojo-Schmitz changed the title Fix #8893: allow for 128th as the denominator for measures [MU4] Fix #8893: allow for 128th as the denominator for measures Aug 20, 2021
<property name="text">
<string>128</string>
</property>
</item>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this going to be replaced with a qml version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, it isn't yet though.

@Jojo-Schmitz Jojo-Schmitz changed the title [MU4] Fix #8893: allow for 128th as the denominator for measures [MU4] Fix #8893: allow for 128th as the denominator for measures, prevent crash in shorter ones Aug 20, 2021
@Jojo-Schmitz Jojo-Schmitz changed the title [MU4] Fix #8893: allow for 128th as the denominator for measures, prevent crash in shorter ones [MU4] Fix #8893: allow for 128th as the denominator for measures, prevent crash on shorter ones Aug 20, 2021
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Aug 20, 2021
and report an errori rather than crash
if the score has something shorter
See musescore#8890 and musescore#8893, backport of musescore#8894, part 1
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Aug 20, 2021
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Aug 20, 2021
and report an error rather than crash
if the score has something shorter
See musescore#8890 and musescore#8893, backport of musescore#8894, part 1
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Aug 20, 2021
if (ticks1.denominator() > 128 || ticks2.denominator() > 128) {
MScore::setError(MsError::CANNOT_SPLIT_MEASURE_TOO_SHORT);
return;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Difficult to test, because of #8895. It doesn't crash, it doesn't split the measure, but also doesn't give any error message

@AntonioBL
Copy link
Contributor

The use of 64th as the denominator limit was also present in the MusicXML importer.
See, for example, the merged PR (in 3.x): #7208
Sometimes, the conversion to ticks could cause rounding errors; in that PR a check was done to prevent rounding errors, by assuming 1/64 as the minimum allowed step.
I don't know if extending to 1/128 in that part of the code could cause probems when importing old exported xml files.

@Jojo-Schmitz
Copy link
Contributor Author

Jojo-Schmitz commented Aug 23, 2021

Well, creating such a short measure (1/128) was possible before, via the split measure tool (and even shorter, leading to a crash, fixed with this PR). Just not the 'official' way, not via the measure poperties UI.

But let's see what the mtests say about such a change. And/or what checking the artifacts does say.

Capella import does allow for it too. But it seems BB and GTP import may not. Not sure whether this is because of MuseScore or because of BB and GTP though? Shouldn't matter much though, as we don't export to those.
It is also not allowed in a time signature or tempo text (and I don't thing it is needed there)?

Indeed an mtest is failing: https://github.com/musescore/MuseScore/pull/8894/checks?check_run_id=3399699714#step:8:8215
Apparently loosing an 128th rest in TestMxmlIO::unusualDurations()?

Actually it seems that mtest is loosing exactly that unprinted/invisible 128th rest, which it should not have shown in the first place, and only does because before that change it can't have a measure with just a single 128th duration in it, or rather one with a 128th in the denominator. So simply that mtest needs to get adjusted.

A musicxml file with a 1/128th measure does import cleanly into this PR with that 3rd commit, importing it without has a issue though, it imports as an 1/64th, but with 2 128th rests, one of which made invisible. That much seems unavoidable, the code not being prepared for such a short MusicXML measure due to that 64th rounding going on. And it did that before this PR too, see above.

@Jojo-Schmitz Jojo-Schmitz force-pushed the denominator branch 8 times, most recently from 86c1c00 to 6319e8d Compare August 23, 2021 13:42
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Aug 23, 2021
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Aug 23, 2021
plus fixing a typo found while searching for the old 64th limit

Backport of musescore#8894, part 4
@Jojo-Schmitz Jojo-Schmitz force-pushed the denominator branch 4 times, most recently from f824853 to 1c553bc Compare August 25, 2021 10:12
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Aug 30, 2021
and report an error rather than crash
if the score has something shorter
See musescore#8890 and musescore#8893, backport of musescore#8894, part 1
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 23, 2021
and report an error rather than crash
if the score has something shorter

See musescore#8890 and musescore#8893, backport of musescore#8894, part 1
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 23, 2021
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 23, 2021
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 23, 2021
plus fixing a typo found while searching for the old 64th limit

Backport of musescore#8894, part 4
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 26, 2021
and report an error rather than crash
if the score has something shorter

See musescore#8890 and musescore#8893, backport of musescore#8894, part 1
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 26, 2021
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 26, 2021
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 26, 2021
plus fixing a typo found while searching for the old 64th limit

Backport of musescore#8894, part 4
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 29, 2021
and report an error rather than crash
if the score has something shorter

See musescore#8890 and musescore#8893, backport of musescore#8894, part 1
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 29, 2021
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 29, 2021
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 29, 2021
plus fixing a typo found while searching for the old 64th limit

Backport of musescore#8894, part 4
@igorkorsukov igorkorsukov merged commit 6ec236a into musescore:master Oct 28, 2021
@Jojo-Schmitz Jojo-Schmitz deleted the denominator branch October 28, 2021 10:01
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request May 12, 2022
and report an error rather than crash
if the score has something shorter

See musescore#8890 and musescore#8893, backport of musescore#8894, part 1
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request May 12, 2022
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request May 12, 2022
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request May 12, 2022
plus fixing a typo found while searching for the old 64th limit

Backport of musescore#8894, part 4
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Mar 5, 2023
and report an error rather than crash
if the score has something shorter

See musescore#8890 and musescore#8893, backport of musescore#8894, part 1
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Mar 5, 2023
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Mar 5, 2023
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Mar 5, 2023
plus fixing a typo found while searching for the old 64th limit

Backport of musescore#8894, part 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[MU4 Task] Support for more denominators in time signature
4 participants