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

Fix #304918: Channel lists contain bad values after an instrument change #6050

Merged
merged 1 commit into from
May 12, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix #304918: Channel lists contain bad values after an instrument change
Resolves: https://musescore.org/en/node/304918.

Since an instrument change applies to an entire part rather than a single
staff, it is necessary to update the channel lists for all staves belonging
to the part when an instrument change occurs, and not just the staff where
the instrument change is placed.
  • Loading branch information
mattmcclinch committed May 6, 2020
commit a1bafa3efcce32ac81a0ce83505439cb4a75032d
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