Skip to content

Commit

Permalink
fix #289298: scores don't playback properly online, patches wrong in …
Browse files Browse the repository at this point in the history
…mixer <3.1
  • Loading branch information
jthistle committed May 17, 2019
1 parent 66b30c3 commit 5065542
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
11 changes: 5 additions & 6 deletions libmscore/instrument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,9 @@ void Channel::write(XmlWriter& xml, const Part* part) const
if (e.type() == ME_INVALID)
continue;
if (e.type() == ME_CONTROLLER) {
// don't write if automatically switched
if ((e.dataA() == CTRL_HBANK || e.dataA() == CTRL_LBANK) && !_userBankController)
continue;
if (e.dataA() == CTRL_HBANK && e.dataB() == 0)
continue;
if (e.dataA() == CTRL_LBANK && e.dataB() == 0)
Expand All @@ -679,10 +682,6 @@ void Channel::write(XmlWriter& xml, const Part* part) const
if (_solo)
xml.tag("solo", _solo);

// This way we know not to change channel to expr automatically
if (_userBankController)
xml.tag("userSelectedBank", _userBankController);

if (part && part->masterScore()->exportMidiMapping() && part->score() == part->masterScore()) {
xml.tag("midiPort", part->masterScore()->midiMapping(_channel)->port());
xml.tag("midiChannel", part->masterScore()->midiMapping(_channel)->channel());
Expand Down Expand Up @@ -723,9 +722,11 @@ void Channel::read(XmlReader& e, Part* part)
switch (ctrl) {
case CTRL_HBANK:
_bank = (value << 7) + (_bank & 0x7f);
_userBankController = true;
break;
case CTRL_LBANK:
_bank = (_bank & ~0x7f) + (value & 0x7f);
_userBankController = true;
break;
case CTRL_VOLUME:
_volume = value;
Expand Down Expand Up @@ -772,8 +773,6 @@ void Channel::read(XmlReader& e, Part* part)
_mute = e.readInt();
else if (tag == "solo")
_solo = e.readInt();
else if (tag == "userSelectedBank")
_userBankController = e.readBool();
else if (tag == "midiPort") {
midiPort = e.readInt();
}
Expand Down
1 change: 1 addition & 0 deletions libmscore/instrument.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ class Channel {
bool _mute;
bool _solo;

// flags whether the user has changed the bank controller as opposed to switchExpressive
bool _userBankController = false;

mutable std::vector<MidiCoreEvent> _init;
Expand Down

0 comments on commit 5065542

Please sign in to comment.