Skip to content

Commit

Permalink
Merge pull request #6050 from mattmcclinch/304918-update-channel
Browse files Browse the repository at this point in the history
Fix #304918: Channel lists contain bad values after an instrument change
  • Loading branch information
anatoly-os authored May 12, 2020
2 parents e47ced8 + a1bafa3 commit fcb39df
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions libmscore/rendermidi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,10 @@ void Score::updateChannel()
for (Segment* s = fm->first(SegmentType::ChordRest); s; s = s->next1(SegmentType::ChordRest)) {
for (const Element* e : s->annotations()) {
if (e->isInstrumentChange()) {
Staff* staff = Score::staff(e->staffIdx());
for (int voice = 0; voice < VOICES; ++voice)
staff->insertIntoChannelList(voice, s->tick(), 0);
for (Staff* staff : *e->part()->staves()) {
for (int voice = 0; voice < VOICES; ++voice)
staff->insertIntoChannelList(voice, s->tick(), 0);
}
continue;
}
if (!e->isStaffTextBase())
Expand Down

0 comments on commit fcb39df

Please sign in to comment.