Chord symbol root disappears upon editing in part

• Feb 14, 2014 - 21:52
S4 - Minor

Windows 7, GIT commit: 22807df

1) new score
2) enter chord symbol "G7"
3) file / parts
4) new all
5) ok
6) visit part
7) double click chord symbol to edit
8) Esc

Result: only "7" is displayed

I can see this is because the part at that point has a chordList but there is nothing in the renderListBase or renderListRoot members. When the chordList is copied to the parts, not everything is making it. I actually thought this was working last summer when I redid the chord symbol rendering, and in fact I thought I specifically remember adding a copy constructor at some point, but maybe I'm thinking of something else.


Yes, but rebuilding from source doesn't alter any preference settings you've made in the past. So again, to be totally clear: you don't have a "Style for part" set, and you followed the steps to reproduce above precisely? I think you should also be sure not to have a "Style for score" set, as this could also be a variable based on my analysis.

How about for #24631: General style settings not propagated from scores to parts - did you use the steps in the initial report or the steps in my later response?

Tracing through this in the code, I really can't see how it could possibly work, so I'm pretty sure it will turn out you either have one of the Style preferences set or are missing something in following my steps.

I had debugged it far enough when I first reported it to see why the score was getting a default style rather a copy of the score's style. MScore::defaultStyleForParts (currently mscore.cpp, line 191), when called from Score::Score(Score* parent) (score.cpp line 381), is finding _defaultStyleForParts already set even though the option is *not* set; this appeared to be a copy of _defaultStyle.

I'm currently in the middle of a full build which takes a while on my system, so I can't actually debug further, but just looking at the code, it seems obvious why this happening.

_defaultStyleForParts is initialized in MScore::Init - which is to say, before any score is even loaded - to a copy of _defaultStyle. And it's never modified again. So MScore::defaultStyleForParts is always reporting a default style for parts exists, and it's just a copy of defaultStyle. And thus, Score::Score(Score* parent) is never getting the opportunity to propagate its own style.

I don't understand how the text style *is* getting propagated, actually. Probably an issue with how deeply some of the style copies are performed.

But I suspect that simply replacing the initialization of defaultStyleForParts with 0 would fix the problem for now.

I can now verify that simply eliminating the initialization of _defaultStyleForParts, so it starts off 0, fixes these problems. Parts then inherit the score style, including its chordList, so newly entered or edited chord symbols render correctly.

But in light of the outstanding request for style for parts to be a per-score parameter and all the ensuing discussion, I think rather than submit a PR for this, we should decide how we want to solve this "for real" - see #24030: Style for Parts.