Skip to content

Commit aa7f5cc

Browse files
mattmcclinchJojo-Schmitz
authored andcommitted
Fix #307704: Capo settings applied via staff text do not affect chord symbols
Resolves: https://musescore.org/en/node/307704 Backport of musescore#7700
1 parent 06df428 commit aa7f5cc

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

libmscore/harmony.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,11 +1272,12 @@ const ChordDescription* Harmony::getDescription(const QString& name, const Parse
12721272

12731273
const RealizedHarmony& Harmony::getRealizedHarmony()
12741274
{
1275-
int offset = 0; //semitone offset for pitch adjustment
12761275
Staff* st = staff();
1276+
int capo = st->capo(tick()) - 1;
1277+
int offset = (capo < 0 ? 0 : capo); //semitone offset for pitch adjustment
12771278
Interval interval = st->part()->instrument(tick())->transpose();
12781279
if (!score()->styleB(Sid::concertPitch))
1279-
offset = interval.chromatic;
1280+
offset += interval.chromatic;
12801281

12811282
//Adjust for Nashville Notation, might be temporary
12821283
// TODO: set dirty on add/remove of keysig

libmscore/rendermidi.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,10 @@ void Score::updateCapo()
137137
if (!fm)
138138
return;
139139
for (Segment* s = fm->first(SegmentType::ChordRest); s; s = s->next1(SegmentType::ChordRest)) {
140-
for (const Element* e : s->annotations()) {
140+
for (Element* e : s->annotations()) {
141+
if (e->isHarmony()) {
142+
toHarmony(e)->realizedHarmony().setDirty(true);
143+
}
141144
if (!e->isStaffTextBase())
142145
continue;
143146
const StaffTextBase* st = toStaffTextBase(e);

0 commit comments

Comments
 (0)