[MusicXML export] decimals in metronome markings get separated
Reported version
3.6
Type
Functional
Frequency
Few
Severity
S3 - Major
Reproducibility
Always
Status
closed
Regression
No
Workaround
No
Project
If you have a metronome tempo with decimals, in MusicXML export these decimals get separated into a words element. The full text should find it's way into the per-minute element.
To reproduce:
1. Open the MuseScore file
2. Export as MusicXML
3. Re-import it
It doesn't matter which separator you take, it get's cut at the first character that isn't a digit.
Attachment | Size |
---|---|
decimalTempo.mscz | 2.96 KB |
decimalTempo.musicxml | 4.31 KB |
Fix version
4.1.0
Comments
Relates to #270643: [EPIC] MusicXML import/export issues
Is:
Should be:
I guess the culprit is:
in 3.x's exportxml.cpp,
findMetronome()
, which is only looking for digits, [0-9], it probaby should be something like:With that it does export the tempo text correctly, but crashes right after having written that to the MusicXML file :-(
At least when build in "Debug" mode, due to a
in 3.x's exportxml.cpp,
elementPosition()
Disabling that
Q_ASSERT()
and it works! (Means that build in "Release" or "RelWithDebInfo" mode it'd work too).Still I'd rather know what that
Q_ASSERT()
is meant to be good for, it also doesn't get hit without my change. @Leon Vinken?In master it is exportxml.cpp, line 4177 and
QRegularExpression numberRegEx("\\d+");
and that doesn't have thisQ_ASSERT()
, so there's hope ;-)See https://github.com/musescore/MuseScore/pull/10442 (for master)
Now also in https://github.com/musescore/MuseScore/pull/9000 (for 3.x)
I thought it would be an easy fix, but that was fast. Thank you!
Those regexp are not exactly easy though ;-)
That (apparently bogus?)
Q_ASSERT()
came into my PR #9000 via the fix for #34451: Include default-x and default-y for Rests, actually a bogus port of it from me...Testfile attached, covering the three supported cases "no dot or comma", "dot" and "comma".
Is that test file supposed to replace the existing one, in the 3.x branch at least? Or is it meant as an addition to the tests in the master branch (and there with a
void tempo5() { mxmlIoTest("testTempo5"); }
inserted after tst_mxml_io.cpp line 220)Edit: I got it, add to master, and slighly adjusted add as
testTempo6
to 3.x (my PR #9000)Had to take out 3 lines from it, for both, master and 3.x, to pass the tests:
Duplicate?
https://musescore.org/en/node/48251
Yes, I marked #48251: [MusicXML] Tempo marking with decimal not handled correctly as such now, even if it is older, as this here does have a fix now ;-)
In reply to Is that test file supposed… by Jojo-Schmitz
The testfile was indeed meant to add to the existing files. Note that it was created on 3.x, which explains the required changes.
Fixed in branch master, commit 62588b4c96
Fix #329060, fix #48251: [MusicXML export] decimals in metronome markings get separated
Fixed in branch master, commit 7f8afab799
_Merge pull request #10442 from Jojo-Schmitz/decimal-tempo-text-xmp-export
[MU4] Fix #329060, fix #48251: [MusicXML export] decimals in metronome markings get separated_
Automatically closed -- issue fixed for 2 weeks with no activity.