Skip to content

Commit

Permalink
fix #64696: MusicXML MIDI port export for Instrument Change element
Browse files Browse the repository at this point in the history
  • Loading branch information
Igevorse authored and lasconic committed Jun 13, 2015
1 parent 6551edd commit dfc17ce
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mscore/exportxml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4465,8 +4465,13 @@ void ExportMusicXml::write(QIODevice* dev)
foreach(int instNr, rim.keys()) {
scoreInstrument(xml, idx + 1, instNr + 1, MScoreTextToMXML::toPlainText(rim.value(instNr)->trackName()));
}
foreach(int instNr, rim.keys()) {
xml.tag(QString("midi-device %1 port=\"%2\"").arg(instrId(idx+1, instNr + 1)).arg(part->midiPort() + 1), "");
for (MxmlReverseInstrumentMap::const_iterator ii = rim.constBegin(); ii != rim.constEnd(); ii++) {
int instNr = ii.key();
int midiPort = part->midiPort() + 1;
if (ii.value()->channel().size() > 0)
midiPort = score()->midiMapping(ii.value()->channel(0)->channel)->port + 1;

xml.tag(QString("midi-device %1 port=\"%2\"").arg(instrId(idx+1, instNr + 1)).arg(midiPort), "");
midiInstrument(xml, idx + 1, instNr + 1, rim.value(instNr), _score);
}
}
Expand Down

0 comments on commit dfc17ce

Please sign in to comment.