-
Notifications
You must be signed in to change notification settings - Fork 2.9k
prefersharpflat none by default for older scores #18449
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
Conversation
68479b0
to
f9999ea
Compare
My first commit fixes the problem for imported MuseScore 1-4 scores, second should do the same for MusicXML now that I've fixed the typo. I have no way of testing other imports, but probably Guitar Pro and Capella need a similar fix. |
I don't understand the test failures. They appear to be showing extra preferSharpFlat tags being written which would be expected if the source files were 400 instead of 410, but at least the first few I looked at (beam-A, for example) are 410. So there shouldn't have been any change at all. I'd love any insight others can provide here. I did also test myself to be sure that key signatures do continue to simplify by default in new scores, and that this survives save/reload. |
It appears that the tests are generally reading scores via mu::engraving::compat::loadMsczOrMscx(), which in turn sets ignoreVersionError when opening scores. I can't follow all the logic from that point forward, but presumably that is how things go awry, and some additional tweak needs to be made to prevent the tests from treating 410 scores as 400 on load. Maybe? |
@MarcSabatella I think the problem is here: MuseScore/src/engraving/rw/mscloader.cpp Lines 67 to 69 in ab483e5
But if we remove that, we'll get trouble too, since those tests have never fully been updated for the 400/410 file format. |
@cbjeukendrup Oh my gosh, you're right, and I was looking right at that function but expecting to see something being forced to 400 so didn't even notice it being set to 302! So needless to say this is not a good state of affairs, but also one that requires way more thinking and probably some hard decision making to deal with appropriately. Having to update all the references to workaround that seems not right (plus, it's way more involved than I have in me). Maybe the stupid quick fix for now is to just stick a "if (!Mscore::testMode)" around the relevant code in my PR? |
@MarcSabatella I created slightly different PR, hopefully, it wouldnt have this utests problem. Lets see #18453 |
@sammik Clever! Let me be sure I understand: the theory here is that if a key signature managed to be written with more than 6 accidentals, then clearly it couldn't really have had AUTO set, set we correct the part at that point. Meaning, most pre-4.1 will still be allowed to default to auto, which is actually nicer than mine - only those that would be likely to actually show the problem will be auto-corrected (!) upon read. Do we think there would ever be a problem in the case of exactly six accidentals? Is it safe to assume in those cases, AUTO and NONE always do the same thing? |
Exactly. Just to clarify - transposing key signature with more than 6 accidentals couldnt have AUTO set. As far as I can tell, exactly six accidentals are not exchanged, so AUTO and NONE do the same thing in that case, yes. |
@sammik 's solution is better, I'll happily close this. |
Resolves: #18425
The default for staff property "prefer sharps or flats for transposing instruments" has changed to a new "auto" setting that aims to simplify spellings, but this isn't compatible with older scores and leads to incorrect playback due to tpc confusion and also incorrect notation upon toggling concert pitch on/off. This PR forces older scores to default to "none" instead of "auto".