Saving segment positions with MuseScore 3 leads to elements with sx attributes being mostly 0

• Oct 21, 2020 - 09:56
Reported version
3.5
Type
Functional
Frequency
Once
Severity
S5 - Suggestion
Reproducibility
Always
Status
active
Regression
No
Workaround
No
Project

Steps to reproduce:

  1. execute musescore export job with .spos as target
  2. sx distance is always 0

Original thread: https://musescore.org/en/node/307253

I actually had feedback by mail from the original user complaining about it and am waiting for a file 'without the issue' to check what is expected. Also have a copy of their code exploiting the data (end of https://musescore.org/en/node/311914 )

But I'm pretty sure the line computing the sx value as: "sx *= ndpi;" coupled with an issue in the voice related algo above would be the region to watch for fix. https://github.com/musescore/MuseScore/blob/3f4894ec3f734f4af6f720195f6…

Will try to fix/pr today.

Attachment Size
repeats.json_.txt 94 bytes
repeats.mscz 6.19 KB
repeats.spos_.xml 8.34 KB
repeats-1.png 86.17 KB

Comments

So I diged into this today, from what I understand, and after getting a better overview of the object model through: https://musescore.org/fr/developers-handbook/references/musescore-inter…

Chord segment have a bbox of (0,0,0,0), so is the sx = 0. When I inspect the child elements composing it, their boxes are correct, but not reflected on the parent element. The rests are still working as their bbox could be accessed correctly. Also, Y/X/SY are based on segment coord, that's why they "continued to work", even tho, I have some question about X below.

Is there an already established way of getting the Chord bbox considering the child objects? Or should I implement it by computing min/max of the childs? Or take another approach? As the codebase is really large and with a long history, it's kind of overwhelming to find an example of that being done. I tried to find an existing one, but without success for the moment and it would be surprising it doesn't exist, but considering musescore work with the Chord bbox (0,0,0,0), I would guess it's not really used like that or never was used before as-is.

Maybe another issue, x distance is not computed correctly, or the same as in ms2. It's actually given by segment page pos, but for instance, ledger lines are not taken into account, in ms3 that means it usually correspond to the the beam position, while it was a more accurate box in ms2.
Cfr the following given by the OP:
https://musescore.org/sites/musescore.org/files/2020-06/test-ms3.spos_…
https://musescore.org/sites/musescore.org/files/2020-06/test-ms2.spos_…
sy value, which is stable to system height in both file can be used to find an easy straight forward conversion factor between the two for analysis, as to your own export, as OP didn't gave image file but musescore file, dependent upon export settings.

I reached to the OP about that, as that might be subtle and maybe didn't broke anything on his side (yet), but should be fixed if Chord bbox are computed correctly imho.

Thanks in advance for you help and pointers,
love an play.