{"action":"created","issue":{"url":"https://api.github.com/repos/LMMS/lmms/issues/2384","repository_url":"https://api.github.com/repos/LMMS/lmms","labels_url":"https://api.github.com/repos/LMMS/lmms/issues/2384/labels{/name}","comments_url":"https://api.github.com/repos/LMMS/lmms/issues/2384/comments","events_url":"https://api.github.com/repos/LMMS/lmms/issues/2384/events","html_url":"https://github.com/LMMS/lmms/issues/2384","id":108556988,"number":2384,"title":"MIDI export doesn't handle B&B tracks correctly","user":{"login":"grejppi","id":772336,"avatar_url":"https://avatars.githubusercontent.com/u/772336?v=3","gravatar_id":"","url":"https://api.github.com/users/grejppi","html_url":"https://github.com/grejppi","followers_url":"https://api.github.com/users/grejppi/followers","following_url":"https://api.github.com/users/grejppi/following{/other_user}","gists_url":"https://api.github.com/users/grejppi/gists{/gist_id}","starred_url":"https://api.github.com/users/grejppi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grejppi/subscriptions","organizations_url":"https://api.github.com/users/grejppi/orgs","repos_url":"https://api.github.com/users/grejppi/repos","events_url":"https://api.github.com/users/grejppi/events{/privacy}","received_events_url":"https://api.github.com/users/grejppi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/LMMS/lmms/labels/bug","name":"bug","color":"e11d21"},{"url":"https://api.github.com/repos/LMMS/lmms/labels/compatibility","name":"compatibility","color":"2c974f"},{"url":"https://api.github.com/repos/LMMS/lmms/labels/critical","name":"critical","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/LMMS/lmms/milestones/3","html_url":"https://github.com/LMMS/lmms/milestones/1.2.0","labels_url":"https://api.github.com/repos/LMMS/lmms/milestones/3/labels","id":614542,"number":3,"title":"1.2.0","description":"To be released during 1.6.2014 - 30.9.2014\r\n\r\n- sample-exact models\r\n- sampletracks playable from middle\r\n- tempo track?\r\n- Calf update?\r\n- LV2 support?","creator":{"login":"diizy","id":6368868,"avatar_url":"https://avatars.githubusercontent.com/u/6368868?v=3","gravatar_id":"","url":"https://api.github.com/users/diizy","html_url":"https://github.com/diizy","followers_url":"https://api.github.com/users/diizy/followers","following_url":"https://api.github.com/users/diizy/following{/other_user}","gists_url":"https://api.github.com/users/diizy/gists{/gist_id}","starred_url":"https://api.github.com/users/diizy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diizy/subscriptions","organizations_url":"https://api.github.com/users/diizy/orgs","repos_url":"https://api.github.com/users/diizy/repos","events_url":"https://api.github.com/users/diizy/events{/privacy}","received_events_url":"https://api.github.com/users/diizy/received_events","type":"User","site_admin":false},"open_issues":39,"closed_issues":157,"state":"open","created_at":"2014-03-30T18:59:50Z","updated_at":"2016-02-18T06:13:38Z","due_on":null,"closed_at":null},"comments":22,"created_at":"2015-09-27T19:50:57Z","updated_at":"2016-02-18T10:09:14Z","closed_at":null,"body":"Every B&B pattern in the project is placed in the resulting MIDI file in sequence, with a new pattern starting on each bar.\r\n\r\nThis may be better explained in pictures. A song like this:\r\n\r\n![kuvakaappaus 2015-09-27 21 05 39](https://cloud.githubusercontent.com/assets/772336/10124347/9fda124e-655b-11e5-9450-7a4bcba6bebd.png)\r\n\r\ngets exported as if it was like this:\r\n\r\n![kuvakaappaus 2015-09-27 21 07 26](https://cloud.githubusercontent.com/assets/772336/10124354/c9727d26-655b-11e5-8ff4-7ad2a1ec683b.png)\r\n\r\n(cc @mohamed--abdel-maksoud)"},"comment":{"url":"https://api.github.com/repos/LMMS/lmms/issues/comments/185637306","html_url":"https://github.com/LMMS/lmms/issues/2384#issuecomment-185637306","issue_url":"https://api.github.com/repos/LMMS/lmms/issues/2384","id":185637306,"user":{"login":"Fastigium","id":10221829,"avatar_url":"https://avatars.githubusercontent.com/u/10221829?v=3","gravatar_id":"","url":"https://api.github.com/users/Fastigium","html_url":"https://github.com/Fastigium","followers_url":"https://api.github.com/users/Fastigium/followers","following_url":"https://api.github.com/users/Fastigium/following{/other_user}","gists_url":"https://api.github.com/users/Fastigium/gists{/gist_id}","starred_url":"https://api.github.com/users/Fastigium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fastigium/subscriptions","organizations_url":"https://api.github.com/users/Fastigium/orgs","repos_url":"https://api.github.com/users/Fastigium/repos","events_url":"https://api.github.com/users/Fastigium/events{/privacy}","received_events_url":"https://api.github.com/users/Fastigium/received_events","type":"User","site_admin":false},"created_at":"2016-02-18T10:09:14Z","updated_at":"2016-02-18T10:09:14Z","body":"After giving more thought to how this would be implemented, I realize that there is another issue we need to address first: *how are B&B tracks expected to be exported?* MIDI has no support for defining patterns and repeating them AFAIK. All we can render are notes and events at certain times, possibly split out in tracks. Because a B&B track can play notes to multiple instruments, putting all notes in a single MIDI track means a loss of information. For drum patterns, this could be solved by putting the notes for each instrument on a different tone, but B&B patterns can contain melodies as well, which wouldn't work well with that approach.\r\n\r\nA different approach would be to export the notes of the song as a whole. That would mean processing B&B tracks into the resulting notes to their instruments, and then exporting those instruments as MIDI tracks. Importing such a MIDI file, assigning the right instruments to the tracks and playing would result in a faithful reproduction of the whole song. However, the individual B&B patterns would be lost and require manual copying and pasting of notes to be restored.\r\n\r\nFL Studio \"fixes\" this problem by not allowing to export the whole song to MIDI at all. It only exports the individual patterns and leaves you to redo the arrangement in the program in which you import it.\r\n\r\nLMMS, however, allows notes that exist only in the song editor, meaning that FL studio's approach won't work. Perhaps the best solution for LMMS would be to export the notes of the song as a whole by default, and allow exporting individual B&B patterns for those who want to use those in a different program. Thoughts?"}}