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

Mu3 opens Mu4 mscz files with wrong scaled element distances #165

Closed
HeinzVo opened this issue Sep 10, 2023 · 22 comments
Closed

Mu3 opens Mu4 mscz files with wrong scaled element distances #165

HeinzVo opened this issue Sep 10, 2023 · 22 comments
Labels

Comments

@HeinzVo
Copy link

HeinzVo commented Sep 10, 2023

Issue type

File corruption

Bug description

Mu3 opens Mu4 mscz files with wrong scaled element distances

[transferred from MuseScore 3.6.2 to MuseScore 4.1.1 and to MuseScore-3.7.0.6132193596-x64]

The ability to open Mu4 mscz files in Mu3.7 is a very interesting feature as long as Mu4 shows too many problems for effectively working with it (especially in the playback system / mixer with soundfonts, instrument selection and playing ornaments like trills).
But at that time after importing Mu4 files in Mu3.7 also some problems are present:

1.)
When opening Mu4-files in Mu3.7, all distances (X-pos/Y-pos of elements, texts, images, spacers, frame distances, ...) are wrong scaled (upscaled) by a factor of 1.250.
So each previously well positioned element must be repositioned or moved back to the right position over the whole score to achieve again a proper readable layout.

2.)
Style "Instrument Name (Part)" is not recognized during import -> text-font, text-size and text-position are set somehow arbitrary.

3.)
"Measure properties / Layout stretch" is not properly recognized during import -> staff with is mostly set too wide, so breaking down before the desired line break.

NOTE: A test score and several screenshots may be found inside the ZIP attachment.

Steps to reproduce

  1. Open a MuseScore_3.6.2 score in MuseScore_3.7. See that all element distances are correct.
  2. Open a MuseScore_3.6.2 score in MuseScore_4.1. See that all element distances are correct.
  3. Save the opened score from MuseScore_4.1 with a new name.
  4. Open the new MuseScore_4.1 score in MuseScore_3.7. See that ALL element distances are scaled up by a factor of 1.25, resulting in an unwanted layout.

Screenshots/Screen recordings

Mu3 opens Mu4 mscz files with wrong scaled element distances.zip

MuseScore Version

3.7.0.6132193596

Regression

No.

Operating system

Windows10 and 11, 64-bit

Additional context

A test score and several screenshots may be found inside the attached ZIP.

@Jojo-Schmitz
Copy link
Owner

Jojo-Schmitz commented Sep 11, 2023

Item 1, that distance factor of 1.25: I can confirm, but have no idea where it stems from, nor where to fix it.

Item 2, "Instrument Name (Long)" from 3.x has been renamed "instrument_excerpt" in Mu4, (and "Composer" to "poet") the others just converted from Sentence case to lower case. So I'd need to specual case this, will do shortly, seems an easy fix.
Workaround: assign it the proper style (it shows with "no style", an empty field, in the Inspector)

Item 3, layout stretch, as far as I can tell it does get imported correctly in 3.7, but after import from 3.6.2, save and reload gets lost already, hence not saved, hence not imported in 3.7. In a 4.x score that does set measure stretch, it'd import correctly in 3.7.
So this is clearly an import bug in 4.x, please report there

@Jojo-Schmitz
Copy link
Owner

Jojo-Schmitz commented Sep 11, 2023

Actually item 3 is not just about the individial stretch of a measure (that seems a bug in Mu4, see above), but also about Format > Style > Measure > Stretch, which have different defaults, 1.2 in Mu2 and 1.5 in Mu4, but apparently do get imported as 1.5 in 3.7. As we're reading in score_style.mss, we're getting all the Mu4 defaults. Guess we'd need s similar mechanism as when reading a 2.x or pre 3.6 score, i.e. read in a defaults style file on Mu4 import.
For now the workaround is to reset that particular setting (and maybe others too) to the Mu3 default.

@HeinzVo
Copy link
Author

HeinzVo commented Sep 11, 2023 via email

@Jojo-Schmitz
Copy link
Owner

Jojo-Schmitz commented Sep 11, 2023

Reg item 1: all these manual positioning are and always have been a problem when going from one major release to the other.

Well. internally, in the score, for item 2 the tag changed from <style>Instrument Name (Part)</style> to <style>instrument_excerpt</style>. As said easy to fix, see #166.

For item 3 there are 2 parts, the individual measure stretch, which apparently gets lost and the default setting for the measure distance, the former to me is a Mu4 import bug. It shows them directly after imporet, but no longer after a save/close/reopen

@Jojo-Schmitz
Copy link
Owner

I guess I found the cause for item 1, the offsets:
You score uses a space setting of 1.4, the default is 1.75 and 1.75/1.4 is 1.25....

@HeinzVo
Copy link
Author

HeinzVo commented Sep 11, 2023 via email

@HeinzVo
Copy link
Author

HeinzVo commented Sep 11, 2023 via email

@HeinzVo
Copy link
Author

HeinzVo commented Sep 11, 2023 via email

@Jojo-Schmitz
Copy link
Owner

Jojo-Schmitz commented Sep 11, 2023

There are a lot of other styles not importing

I know, but we can only import those that do have a 3.x counterpart. I do see quite many that don't and I don't see any that do have a counterpart but have a different name, so nothing we can do about this.
There's just one setting that is available in Mu3 but not in Mu4, about playing chord symbols.

I did not change anything in settings.

Well, you did, your scores uses a space setting of 1.4, the default is 1.7.5 (and was 1.7.64 prior to 3.6)
Nothing wrong about that as such, but this causes the offset differences. Knowing the cause is bringing us to a point where it could possibly get fixed ;-)

Where can this space setting be found?

Format > Page Settings > Scaling > Space

@Jojo-Schmitz
Copy link
Owner

Jojo-Schmitz commented Sep 27, 2023

These offsets are correct, when extracting and using the mscx, but not when using the mscz, so the difference must come from the score_style.mss, some style setting thai is now somehow either different or treated differently between Mu3 and Mu4.

Just which one???
Here's a list of the changed ones (hope I didnd't miss any):

name Mu4(.0/.1) default Mu3 default remark
"pageWidth" 8.27 8.26772 rounding issue
"pageHeight" 11.69 11.6929 rounding issue
"pagePrintableWidth" 7.0889 7.08661 rounding issue
"lyricsMinBottomDistance" 1.5 2 Mu4's default seems better?
"lyricsDashLineThickness" 0.1 0.15
"minMeasureWidth" 8 5
"doubleBarDistance" 0.37 0.55
"endBarDistance" 0.37 0.7
"repeatBarlineDotSeparation" 0.37 0.7
"bracketWidth" 0.45 0.44
"bracketDistance" 0.45 1
"akkoladeWidth" 1.5 1.6
"akkoladeBarDistance" 0.35 0.4
"clefLeftMargin" 0.75 0.8
"stemWidth" 0.1 0.11
"shortestStem" 2.5 2.25
"minNoteDistance" 0.5 0.2
"measureSpacing" 1.5 1.2 certainly responsible for Mu4 score to take more space in Mu3
"ledgerLineLength" 0.33 0.35
"beamMinLen" 0.33 0.35
"propertyDistanceHead" 0.4 1
"propertyDistanceStem" 0.4 1.8
"propertyDistance" 0.4 1
"hairpinLinePosAbove" y: -1.5 -3
"hairpinLinePosBelow" y: 2.5 4
"chordSymbolAFontSize" 10 11
"chordSymbolBFontSize" 10 11
"useStandardNoteNames 1 0
"minMMRestWidth" 4 resp. 6 4
"mmRestNumberPos" -0.5 -1.5
"slurEndWidth" 0.05 0.07
"evenFooterC" $C $:copyright:
"oddFooterC" $C $:copyright:
"tupletStemLeftDistance" 0.5 0
"tupletNoteLeftDistance" 0 0.5
"scaleBarlines" 0 1
"subTitleFontSize" 14 16
"dynamicsFontSize 10 11
"measureNumberPosBelow y: 1 2
"footerOffset" y: 0 5 better use Mu3's default to prevent collisions?
"letRingLineWidth" 0.11 0.15
"palmMutePosAbove" y: -4 resp. 0 -4
"palmMutePosBelow" y: 4 resp. 0 4
"palmMuteLineWidth" 0.11 0.15
"articulationMinDistance" 0.4 0.5
"Spatium" 1.74978 1.75 rounding issue

OTOH on importing the mscx, that "Spatium" value is set to default (as are all others), 1.75, the sample score here though is using 1.4, and that's being used when reading the mscz, and the ratio between both is exactly the factor we see here.

But then again changing the Spatium to 1.4 doesn't fix those offsets

@HeinzVo
Copy link
Author

HeinzVo commented Sep 27, 2023 via email

@Jojo-Schmitz
Copy link
Owner

Jojo-Schmitz commented Sep 27, 2023

The problem with those x/y -positions definitly is related to these style setting, I just haven't yet found how and to which.

Proof is that they are wrong only when reading the mscz (and along with that the style settings), but not when reading the mscx (and with that taking all the Mu3 defaults), which does not change those positions.
And the fact that the default Spatium (1.75) divided by your setting (1.4) is exactly the factor to those positions (1.25).

But yes, it is not about those default settings, not neccesarily at least

OK, it definitly is the Spatium setting, as soon as I load this minimal style file:

<?xml version="1.0" encoding="UTF-8"?>
<museScore version="4.10">
  <Style>
    <Spatium>1.4</Spatium>
    </Style>
  </museScore>

on top of the mscx, I do get those wrong positions.
Not though if I set that value manually, in Format > Page settings.

Now need to find why this behaves differently...

@HeinzVo
Copy link
Author

HeinzVo commented Sep 28, 2023

Ok, but offset positions and spacers are relative numbers for any spatium (or overall page) scaling, so the numbers should not be changed or rescaled during any import procedure. In the same way manually changing the spatium (page) scaling should not affect relative offsets and spacer lengths.

Is there a way to "compensate" the unwanted rescaling during import, if the actual spatium setting is known or read first or last?

Note: Importing Mu3 scores to Mu4 as well do NOT rescale offsets and spacers (but correctly import the spatium setting), so it should be expected vice versa.

@Jojo-Schmitz
Copy link
Owner

A workaround is to reset the Spatium to 1.75 in Mu4, before importing the score in Mu3, and then in Mu3 set it to the desired value.
I'm still investigating why this screws up so badly.

@HeinzVo
Copy link
Author

HeinzVo commented Sep 28, 2023 via email

@Jojo-Schmitz
Copy link
Owner

I'm well aware of that

@HeinzVo
Copy link
Author

HeinzVo commented Sep 28, 2023

An other question: Why does the import of Mu3-mscz-scores work correctly on that behavior? Doesn't it pass exactly the same import/opening procedure sequence as reading Mu4-mscz-scores for interpreting all the tags?

@Jojo-Schmitz
Copy link
Owner

Jojo-Schmitz commented Sep 28, 2023

No. Mu4 files always contain all style settings, Mu3 files only the ones chyanged away from the default.
And the style settings are read as part of the score for Mu3 scores (and they all sit at its start), but after the score for Mu4 scores.

Hmm, hold on, that might be the trick...

That nailed it!! (along with another small change)

See #195

I'll still deal with those other default changes, separately

@HeinzVo
Copy link
Author

HeinzVo commented Sep 28, 2023

I just tried out the release MuseScore-3.7.0.6340026096-x64.
Fantastic, it really seems to work correct. If I reduce "Format/Stretch/Decrease Layout Stretch" 3-times, then the page layout looks almost perfect (except for issue #141).
Congratulations!

For the Mu4.x-import feature now it only remains issue #174 where all informative texts get lost. Hope this can be fixed as well now, so that Mu4.x-import then will get to a fairly stable feature. Thanks.
MuseScore 3.7.0_Some Staff texts lost when imported from 4.x.zip

@Jojo-Schmitz
Copy link
Owner

Stretch seems to get lost in Mu4 already, on Mu3 score import. On the way back it should work, so it seems there's a bug in Mu4

@Jojo-Schmitz
Copy link
Owner

OK,I'll merge #195 then

@Jojo-Schmitz
Copy link
Owner

The lost of stretch has been reported upstream now, see musescore#19625
It is seen as by Design though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants