{"action":"created","issue":{"url":"https://api.github.com/repos/MTG/dunya/issues/312","repository_url":"https://api.github.com/repos/MTG/dunya","labels_url":"https://api.github.com/repos/MTG/dunya/issues/312/labels{/name}","comments_url":"https://api.github.com/repos/MTG/dunya/issues/312/comments","events_url":"https://api.github.com/repos/MTG/dunya/issues/312/events","html_url":"https://github.com/MTG/dunya/issues/312","id":132213358,"number":312,"title":"Erroneous note model generated for notes with few occurences","user":{"login":"sertansenturk","id":4540641,"avatar_url":"https://avatars.githubusercontent.com/u/4540641?v=3","gravatar_id":"","url":"https://api.github.com/users/sertansenturk","html_url":"https://github.com/sertansenturk","followers_url":"https://api.github.com/users/sertansenturk/followers","following_url":"https://api.github.com/users/sertansenturk/following{/other_user}","gists_url":"https://api.github.com/users/sertansenturk/gists{/gist_id}","starred_url":"https://api.github.com/users/sertansenturk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sertansenturk/subscriptions","organizations_url":"https://api.github.com/users/sertansenturk/orgs","repos_url":"https://api.github.com/users/sertansenturk/repos","events_url":"https://api.github.com/users/sertansenturk/events{/privacy}","received_events_url":"https://api.github.com/users/sertansenturk/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/MTG/dunya/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/MTG/dunya/labels/makam","name":"makam","color":"0052cc"}],"state":"closed","locked":false,"assignee":{"login":"sertansenturk","id":4540641,"avatar_url":"https://avatars.githubusercontent.com/u/4540641?v=3","gravatar_id":"","url":"https://api.github.com/users/sertansenturk","html_url":"https://github.com/sertansenturk","followers_url":"https://api.github.com/users/sertansenturk/followers","following_url":"https://api.github.com/users/sertansenturk/following{/other_user}","gists_url":"https://api.github.com/users/sertansenturk/gists{/gist_id}","starred_url":"https://api.github.com/users/sertansenturk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sertansenturk/subscriptions","organizations_url":"https://api.github.com/users/sertansenturk/orgs","repos_url":"https://api.github.com/users/sertansenturk/repos","events_url":"https://api.github.com/users/sertansenturk/events{/privacy}","received_events_url":"https://api.github.com/users/sertansenturk/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/MTG/dunya/milestones/5","html_url":"https://github.com/MTG/dunya/milestones/Makam","labels_url":"https://api.github.com/repos/MTG/dunya/milestones/5/labels","id":564830,"number":5,"title":"Makam","description":"","creator":{"login":"alastair","id":19217,"avatar_url":"https://avatars.githubusercontent.com/u/19217?v=3","gravatar_id":"","url":"https://api.github.com/users/alastair","html_url":"https://github.com/alastair","followers_url":"https://api.github.com/users/alastair/followers","following_url":"https://api.github.com/users/alastair/following{/other_user}","gists_url":"https://api.github.com/users/alastair/gists{/gist_id}","starred_url":"https://api.github.com/users/alastair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alastair/subscriptions","organizations_url":"https://api.github.com/users/alastair/orgs","repos_url":"https://api.github.com/users/alastair/repos","events_url":"https://api.github.com/users/alastair/events{/privacy}","received_events_url":"https://api.github.com/users/alastair/received_events","type":"User","site_admin":false},"open_issues":14,"closed_issues":68,"state":"open","created_at":"2014-02-10T15:35:27Z","updated_at":"2016-03-04T10:14:34Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-02-08T17:51:49Z","updated_at":"2016-03-04T10:14:34Z","closed_at":"2016-03-04T10:14:34Z","body":"While we are generating the note models per note symbol, we compute the histogram from the frequency values in the aligned trajectories, select the highest peak as the stable frequency and normalize the histogram such that the height of this staple peak is the same with the corresponding value in the overall pitch histogram (computed from the whole predominant melody.)\r\n\r\nIf there are a few instances of a note symbol in a composition, there is a higher chance that the note will be misaligned to a stable pitch belonging to another note symbol. In this case two errors occur: **1)** The stable pitch will be assigned erroneously, **2)** The note histogram might overflow the overall histogram.\r\n\r\nOne example is the note symbol C6 in the recording [Sevdi Gönlüm Ey Melek Sima Seni](http://dunya.compmusic.upf.edu/makam/recording/dfc16e22-0aae-4bd0-a32c-5c000130e96a). From the [note_model json file](http://dunya.compmusic.upf.edu/document/by-id/dfc16e22-0aae-4bd0-a32c-5c000130e96a/correctedpitchmakam?v=0.2&subtype=notemodels), we can see that there are only two trajectories aligned. The first trajectory (1:37) is a misalignment to a performed A5 note. It accumulates a higher peak than the actual value of C6, so the stable_pitch is assigned to 378Hz (= A5). You can also see that the note model is overflowing the histogram at that time instant as the note histogram is normalized according to this peak.\r\n\r\nI have to:\r\n- [ ] Make sure that the peak is searched around a threshold (say +-75 cents) around the theoretical interval. \r\n- [ ] If there are no peaks found, I can leave the stable peak \"unassigned,\" since it is more likely a misalignment.\r\n- [ ] Instead of the peak height of the stable pitch, I can normalize the model according to the ratio len(sum(pitch_trajectory)) / len(predominant_melody). \r\n- If the above is not appealing visually, I can first check for a significant overflow between the note histogram and the overall histogram. If there is, I can apply the above normalization instead.\r\n"},"comment":{"url":"https://api.github.com/repos/MTG/dunya/issues/comments/192220162","html_url":"https://github.com/MTG/dunya/issues/312#issuecomment-192220162","issue_url":"https://api.github.com/repos/MTG/dunya/issues/312","id":192220162,"user":{"login":"sertansenturk","id":4540641,"avatar_url":"https://avatars.githubusercontent.com/u/4540641?v=3","gravatar_id":"","url":"https://api.github.com/users/sertansenturk","html_url":"https://github.com/sertansenturk","followers_url":"https://api.github.com/users/sertansenturk/followers","following_url":"https://api.github.com/users/sertansenturk/following{/other_user}","gists_url":"https://api.github.com/users/sertansenturk/gists{/gist_id}","starred_url":"https://api.github.com/users/sertansenturk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sertansenturk/subscriptions","organizations_url":"https://api.github.com/users/sertansenturk/orgs","repos_url":"https://api.github.com/users/sertansenturk/repos","events_url":"https://api.github.com/users/sertansenturk/events{/privacy}","received_events_url":"https://api.github.com/users/sertansenturk/received_events","type":"User","site_admin":false},"created_at":"2016-03-04T10:14:34Z","updated_at":"2016-03-04T10:14:34Z","body":"This should be addressed in the alignednotemodels package."}}