{"action":"created","comment":{"url":"https://api.github.com/repos/musescore/MuseScore/pulls/comments/32269638","id":32269638,"diff_hunk":"@@ -4430,8 +4430,13 @@ void ExportMusicXml::write(QIODevice* dev)\n                   foreach(int instNr, rim.keys()) {\n                         scoreInstrument(xml, idx + 1, instNr + 1, MScoreTextToMXML::toPlainText(rim.value(instNr)->trackName()));\n                         }\n-                  foreach(int instNr, rim.keys()) {\n-                        xml.tag(QString(\"midi-device %1 port=\\\"%2\\\"\").arg(instrId(idx+1, instNr + 1)).arg(part->midiPort() + 1), \"\");\n+                  for (MxmlReverseInstrumentMap::const_iterator ii = rim.constBegin(); ii != rim.constEnd(); ii++) {\n+                        int instNr = ii.key();\n+                        int midiPort = part->midiPort() + 1;\n+                        if (ii.value()->channel().size() > 0)\n+                              midiPort = score()->midiMapping(ii.value()->channel(0)->channel)->port + 1;\n+\n+                        xml.tag(QString(\"midi-device %1 port=\\\"%2\\\"\").arg(instrId(idx+1, instNr + 1)).arg(midiPort), \"\");","path":"mscore/exportxml.cpp","position":12,"original_position":12,"commit_id":"cdfdeaaa6bde7ecdfa6e75535ebad347c0849391","original_commit_id":"cdfdeaaa6bde7ecdfa6e75535ebad347c0849391","user":{"login":"lasconic","id":234271,"avatar_url":"https://avatars.githubusercontent.com/u/234271?v=3","gravatar_id":"","url":"https://api.github.com/users/lasconic","html_url":"https://github.com/lasconic","followers_url":"https://api.github.com/users/lasconic/followers","following_url":"https://api.github.com/users/lasconic/following{/other_user}","gists_url":"https://api.github.com/users/lasconic/gists{/gist_id}","starred_url":"https://api.github.com/users/lasconic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lasconic/subscriptions","organizations_url":"https://api.github.com/users/lasconic/orgs","repos_url":"https://api.github.com/users/lasconic/repos","events_url":"https://api.github.com/users/lasconic/events{/privacy}","received_events_url":"https://api.github.com/users/lasconic/received_events","type":"User","site_admin":false},"body":"In MusicXML, the port should be between 1-16. As far as I understand there is nothing done to verify this in Score::rebuildMidiMapping or here. is there anything we could do?","created_at":"2015-06-11T21:19:54Z","updated_at":"2015-06-11T21:19:54Z","html_url":"https://github.com/musescore/MuseScore/pull/2058#discussion_r32269638","pull_request_url":"https://api.github.com/repos/musescore/MuseScore/pulls/2058","_links":{"self":{"href":"https://api.github.com/repos/musescore/MuseScore/pulls/comments/32269638"},"html":{"href":"https://github.com/musescore/MuseScore/pull/2058#discussion_r32269638"},"pull_request":{"href":"https://api.github.com/repos/musescore/MuseScore/pulls/2058"}}},"pull_request":{"url":"https://api.github.com/repos/musescore/MuseScore/pulls/2058","id":37488612,"html_url":"https://github.com/musescore/MuseScore/pull/2058","diff_url":"https://github.com/musescore/MuseScore/pull/2058.diff","patch_url":"https://github.com/musescore/MuseScore/pull/2058.patch","issue_url":"https://api.github.com/repos/musescore/MuseScore/issues/2058","number":2058,"state":"open","locked":false,"title":"fix #64696: MusicXML MIDI port export for Instrument Change element","user":{"login":"Igevorse","id":6889805,"avatar_url":"https://avatars.githubusercontent.com/u/6889805?v=3","gravatar_id":"","url":"https://api.github.com/users/Igevorse","html_url":"https://github.com/Igevorse","followers_url":"https://api.github.com/users/Igevorse/followers","following_url":"https://api.github.com/users/Igevorse/following{/other_user}","gists_url":"https://api.github.com/users/Igevorse/gists{/gist_id}","starred_url":"https://api.github.com/users/Igevorse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Igevorse/subscriptions","organizations_url":"https://api.github.com/users/Igevorse/orgs","repos_url":"https://api.github.com/users/Igevorse/repos","events_url":"https://api.github.com/users/Igevorse/events{/privacy}","received_events_url":"https://api.github.com/users/Igevorse/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-11T17:34:07Z","updated_at":"2015-06-11T21:19:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"34e2315905a9bc23f69bda7f91adad43b100675d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/musescore/MuseScore/pulls/2058/commits","review_comments_url":"https://api.github.com/repos/musescore/MuseScore/pulls/2058/comments","review_comment_url":"https://api.github.com/repos/musescore/MuseScore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/musescore/MuseScore/issues/2058/comments","statuses_url":"https://api.github.com/repos/musescore/MuseScore/statuses/cdfdeaaa6bde7ecdfa6e75535ebad347c0849391","head":{"label":"Igevorse:bugs","ref":"bugs","sha":"cdfdeaaa6bde7ecdfa6e75535ebad347c0849391","user":{"login":"Igevorse","id":6889805,"avatar_url":"https://avatars.githubusercontent.com/u/6889805?v=3","gravatar_id":"","url":"https://api.github.com/users/Igevorse","html_url":"https://github.com/Igevorse","followers_url":"https://api.github.com/users/Igevorse/followers","following_url":"https://api.github.com/users/Igevorse/following{/other_user}","gists_url":"https://api.github.com/users/Igevorse/gists{/gist_id}","starred_url":"https://api.github.com/users/Igevorse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Igevorse/subscriptions","organizations_url":"https://api.github.com/users/Igevorse/orgs","repos_url":"https://api.github.com/users/Igevorse/repos","events_url":"https://api.github.com/users/Igevorse/events{/privacy}","received_events_url":"https://api.github.com/users/Igevorse/received_events","type":"User","site_admin":false},"repo":{"id":17602466,"name":"MuseScore","full_name":"Igevorse/MuseScore","owner":{"login":"Igevorse","id":6889805,"avatar_url":"https://avatars.githubusercontent.com/u/6889805?v=3","gravatar_id":"","url":"https://api.github.com/users/Igevorse","html_url":"https://github.com/Igevorse","followers_url":"https://api.github.com/users/Igevorse/followers","following_url":"https://api.github.com/users/Igevorse/following{/other_user}","gists_url":"https://api.github.com/users/Igevorse/gists{/gist_id}","starred_url":"https://api.github.com/users/Igevorse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Igevorse/subscriptions","organizations_url":"https://api.github.com/users/Igevorse/orgs","repos_url":"https://api.github.com/users/Igevorse/repos","events_url":"https://api.github.com/users/Igevorse/events{/privacy}","received_events_url":"https://api.github.com/users/Igevorse/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Igevorse/MuseScore","description":"MuseScore is an open source and free music notation software. For support, contribution, bug reports, visit MuseScore.org. Fork and make pull requests!","fork":true,"url":"https://api.github.com/repos/Igevorse/MuseScore","forks_url":"https://api.github.com/repos/Igevorse/MuseScore/forks","keys_url":"https://api.github.com/repos/Igevorse/MuseScore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Igevorse/MuseScore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Igevorse/MuseScore/teams","hooks_url":"https://api.github.com/repos/Igevorse/MuseScore/hooks","issue_events_url":"https://api.github.com/repos/Igevorse/MuseScore/issues/events{/number}","events_url":"https://api.github.com/repos/Igevorse/MuseScore/events","assignees_url":"https://api.github.com/repos/Igevorse/MuseScore/assignees{/user}","branches_url":"https://api.github.com/repos/Igevorse/MuseScore/branches{/branch}","tags_url":"https://api.github.com/repos/Igevorse/MuseScore/tags","blobs_url":"https://api.github.com/repos/Igevorse/MuseScore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Igevorse/MuseScore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Igevorse/MuseScore/git/refs{/sha}","trees_url":"https://api.github.com/repos/Igevorse/MuseScore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Igevorse/MuseScore/statuses/{sha}","languages_url":"https://api.github.com/repos/Igevorse/MuseScore/languages","stargazers_url":"https://api.github.com/repos/Igevorse/MuseScore/stargazers","contributors_url":"https://api.github.com/repos/Igevorse/MuseScore/contributors","subscribers_url":"https://api.github.com/repos/Igevorse/MuseScore/subscribers","subscription_url":"https://api.github.com/repos/Igevorse/MuseScore/subscription","commits_url":"https://api.github.com/repos/Igevorse/MuseScore/commits{/sha}","git_commits_url":"https://api.github.com/repos/Igevorse/MuseScore/git/commits{/sha}","comments_url":"https://api.github.com/repos/Igevorse/MuseScore/comments{/number}","issue_comment_url":"https://api.github.com/repos/Igevorse/MuseScore/issues/comments{/number}","contents_url":"https://api.github.com/repos/Igevorse/MuseScore/contents/{+path}","compare_url":"https://api.github.com/repos/Igevorse/MuseScore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Igevorse/MuseScore/merges","archive_url":"https://api.github.com/repos/Igevorse/MuseScore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Igevorse/MuseScore/downloads","issues_url":"https://api.github.com/repos/Igevorse/MuseScore/issues{/number}","pulls_url":"https://api.github.com/repos/Igevorse/MuseScore/pulls{/number}","milestones_url":"https://api.github.com/repos/Igevorse/MuseScore/milestones{/number}","notifications_url":"https://api.github.com/repos/Igevorse/MuseScore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Igevorse/MuseScore/labels{/name}","releases_url":"https://api.github.com/repos/Igevorse/MuseScore/releases{/id}","created_at":"2014-03-10T17:55:16Z","updated_at":"2014-06-16T07:20:13Z","pushed_at":"2015-06-11T18:06:53Z","git_url":"git://github.com/Igevorse/MuseScore.git","ssh_url":"git@github.com:Igevorse/MuseScore.git","clone_url":"https://github.com/Igevorse/MuseScore.git","svn_url":"https://github.com/Igevorse/MuseScore","homepage":"http://musescore.org","size":196347,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"musescore:master","ref":"master","sha":"d8321d928b8305b79476d537f7092473cee7c3eb","user":{"login":"musescore","id":380563,"avatar_url":"https://avatars.githubusercontent.com/u/380563?v=3","gravatar_id":"","url":"https://api.github.com/users/musescore","html_url":"https://github.com/musescore","followers_url":"https://api.github.com/users/musescore/followers","following_url":"https://api.github.com/users/musescore/following{/other_user}","gists_url":"https://api.github.com/users/musescore/gists{/gist_id}","starred_url":"https://api.github.com/users/musescore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/musescore/subscriptions","organizations_url":"https://api.github.com/users/musescore/orgs","repos_url":"https://api.github.com/users/musescore/repos","events_url":"https://api.github.com/users/musescore/events{/privacy}","received_events_url":"https://api.github.com/users/musescore/received_events","type":"Organization","site_admin":false},"repo":{"id":4454793,"name":"MuseScore","full_name":"musescore/MuseScore","owner":{"login":"musescore","id":380563,"avatar_url":"https://avatars.githubusercontent.com/u/380563?v=3","gravatar_id":"","url":"https://api.github.com/users/musescore","html_url":"https://github.com/musescore","followers_url":"https://api.github.com/users/musescore/followers","following_url":"https://api.github.com/users/musescore/following{/other_user}","gists_url":"https://api.github.com/users/musescore/gists{/gist_id}","starred_url":"https://api.github.com/users/musescore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/musescore/subscriptions","organizations_url":"https://api.github.com/users/musescore/orgs","repos_url":"https://api.github.com/users/musescore/repos","events_url":"https://api.github.com/users/musescore/events{/privacy}","received_events_url":"https://api.github.com/users/musescore/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/musescore/MuseScore","description":"MuseScore is an open source and free music notation software. For support, contribution, bug reports, visit MuseScore.org. Fork and make pull requests!","fork":false,"url":"https://api.github.com/repos/musescore/MuseScore","forks_url":"https://api.github.com/repos/musescore/MuseScore/forks","keys_url":"https://api.github.com/repos/musescore/MuseScore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/musescore/MuseScore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/musescore/MuseScore/teams","hooks_url":"https://api.github.com/repos/musescore/MuseScore/hooks","issue_events_url":"https://api.github.com/repos/musescore/MuseScore/issues/events{/number}","events_url":"https://api.github.com/repos/musescore/MuseScore/events","assignees_url":"https://api.github.com/repos/musescore/MuseScore/assignees{/user}","branches_url":"https://api.github.com/repos/musescore/MuseScore/branches{/branch}","tags_url":"https://api.github.com/repos/musescore/MuseScore/tags","blobs_url":"https://api.github.com/repos/musescore/MuseScore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/musescore/MuseScore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/musescore/MuseScore/git/refs{/sha}","trees_url":"https://api.github.com/repos/musescore/MuseScore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/musescore/MuseScore/statuses/{sha}","languages_url":"https://api.github.com/repos/musescore/MuseScore/languages","stargazers_url":"https://api.github.com/repos/musescore/MuseScore/stargazers","contributors_url":"https://api.github.com/repos/musescore/MuseScore/contributors","subscribers_url":"https://api.github.com/repos/musescore/MuseScore/subscribers","subscription_url":"https://api.github.com/repos/musescore/MuseScore/subscription","commits_url":"https://api.github.com/repos/musescore/MuseScore/commits{/sha}","git_commits_url":"https://api.github.com/repos/musescore/MuseScore/git/commits{/sha}","comments_url":"https://api.github.com/repos/musescore/MuseScore/comments{/number}","issue_comment_url":"https://api.github.com/repos/musescore/MuseScore/issues/comments{/number}","contents_url":"https://api.github.com/repos/musescore/MuseScore/contents/{+path}","compare_url":"https://api.github.com/repos/musescore/MuseScore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/musescore/MuseScore/merges","archive_url":"https://api.github.com/repos/musescore/MuseScore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/musescore/MuseScore/downloads","issues_url":"https://api.github.com/repos/musescore/MuseScore/issues{/number}","pulls_url":"https://api.github.com/repos/musescore/MuseScore/pulls{/number}","milestones_url":"https://api.github.com/repos/musescore/MuseScore/milestones{/number}","notifications_url":"https://api.github.com/repos/musescore/MuseScore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/musescore/MuseScore/labels{/name}","releases_url":"https://api.github.com/repos/musescore/MuseScore/releases{/id}","created_at":"2012-05-26T12:46:33Z","updated_at":"2015-06-11T07:57:26Z","pushed_at":"2015-06-11T21:01:24Z","git_url":"git://github.com/musescore/MuseScore.git","ssh_url":"git@github.com:musescore/MuseScore.git","clone_url":"https://github.com/musescore/MuseScore.git","svn_url":"https://github.com/musescore/MuseScore","homepage":"http://musescore.org","size":368163,"stargazers_count":694,"watchers_count":694,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":411,"mirror_url":null,"open_issues_count":34,"forks":411,"open_issues":34,"watchers":694,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/musescore/MuseScore/pulls/2058"},"html":{"href":"https://github.com/musescore/MuseScore/pull/2058"},"issue":{"href":"https://api.github.com/repos/musescore/MuseScore/issues/2058"},"comments":{"href":"https://api.github.com/repos/musescore/MuseScore/issues/2058/comments"},"review_comments":{"href":"https://api.github.com/repos/musescore/MuseScore/pulls/2058/comments"},"review_comment":{"href":"https://api.github.com/repos/musescore/MuseScore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/musescore/MuseScore/pulls/2058/commits"},"statuses":{"href":"https://api.github.com/repos/musescore/MuseScore/statuses/cdfdeaaa6bde7ecdfa6e75535ebad347c0849391"}}}}