Skip to content

Commit

Permalink
Merge pull request #2058 from Igevorse/bugs
Browse files Browse the repository at this point in the history
fix #64696: MusicXML MIDI port export for Instrument Change element
  • Loading branch information
lasconic committed Jun 13, 2015
2 parents 75fa4d0 + 55fe854 commit 520b62b
Show file tree
Hide file tree
Showing 4 changed files with 2,818 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 (auto 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
Loading

0 comments on commit 520b62b

Please sign in to comment.