{"action":"created","issue":{"url":"https://api.github.com/repos/cuthbertLab/music21/issues/229","repository_url":"https://api.github.com/repos/cuthbertLab/music21","labels_url":"https://api.github.com/repos/cuthbertLab/music21/issues/229/labels{/name}","comments_url":"https://api.github.com/repos/cuthbertLab/music21/issues/229/comments","events_url":"https://api.github.com/repos/cuthbertLab/music21/issues/229/events","html_url":"https://github.com/cuthbertLab/music21/issues/229","id":243417824,"number":229,"title":"MEI note w/o accid -- should get from KeySignature?","user":{"login":"mscuthbert","id":3521479,"avatar_url":"https://avatars0.githubusercontent.com/u/3521479?v=4","gravatar_id":"","url":"https://api.github.com/users/mscuthbert","html_url":"https://github.com/mscuthbert","followers_url":"https://api.github.com/users/mscuthbert/followers","following_url":"https://api.github.com/users/mscuthbert/following{/other_user}","gists_url":"https://api.github.com/users/mscuthbert/gists{/gist_id}","starred_url":"https://api.github.com/users/mscuthbert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mscuthbert/subscriptions","organizations_url":"https://api.github.com/users/mscuthbert/orgs","repos_url":"https://api.github.com/users/mscuthbert/repos","events_url":"https://api.github.com/users/mscuthbert/events{/privacy}","received_events_url":"https://api.github.com/users/mscuthbert/received_events","type":"User","site_admin":false},"labels":[{"id":64195483,"url":"https://api.github.com/repos/cuthbertLab/music21/labels/bug","name":"bug","color":"fc2929","default":true},{"id":65327815,"url":"https://api.github.com/repos/cuthbertLab/music21/labels/priority:medium","name":"priority:medium","color":"fef2c0","default":false},{"id":65332104,"url":"https://api.github.com/repos/cuthbertLab/music21/labels/verified:yes","name":"verified:yes","color":"009800","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-07-17T14:39:06Z","updated_at":"2017-07-25T18:17:08Z","closed_at":null,"body":"@ahankinson @crantila -- when parsing:\r\n\r\n```\r\nc = converter.parse('http://digitalduchemin.org/mei/DC0816.xml', format='mei')\r\n```\r\n\r\nAll of the Bs are coming out as b-naturals (first one, m. 2, staff 3).  When looking at the MEI, there is no accid. tag for these notes.  The PDF http://ricercar.cesr.univ-tours.fr/3-programmes/EMN/duchemin/sources/155012-16/155012-16-pdf-moderne.pdf implies that the accidental should come from the key signature in these cases.  Is this the correct interpretation of MEI?  If so, then after parsing, we should run:\r\n\r\n```\r\nfor n in score.recurse().getElementsByClass('Note'):\r\n      if n.pitch.accidental is None:\r\n           keyContext = n.getContextByClass('KeySignature')\r\n           if keyContext is not None:\r\n                n.pitch.accidental = keyContext.accidentalByStep(n.pitch.step)\r\n```\r\n\r\nand similarly for chords:\r\n\r\n```\r\nfor c in score.recurse().getElementsByClass('Chord'):\r\n     keyContext = c.getContextByClass('KeySignature')\r\n     if keyContext is None:\r\n          continue\r\n     for p in c.pitches:\r\n           if p.accidental is None:\r\n               p.accidental = keyContext.accidentalByStep(p.step)\r\n```\r\n\r\nthoughts?\r\n\r\nI would NOT run the getContextByClass() while parsing, because it runs MUCH faster if the score has not had elements added to it since the last run.  Thus doing it as a post initial-parse step would be better.\r\n\r\nBest, Myke"},"comment":{"url":"https://api.github.com/repos/cuthbertLab/music21/issues/comments/317824013","html_url":"https://github.com/cuthbertLab/music21/issues/229#issuecomment-317824013","issue_url":"https://api.github.com/repos/cuthbertLab/music21/issues/229","id":317824013,"user":{"login":"mscuthbert","id":3521479,"avatar_url":"https://avatars0.githubusercontent.com/u/3521479?v=4","gravatar_id":"","url":"https://api.github.com/users/mscuthbert","html_url":"https://github.com/mscuthbert","followers_url":"https://api.github.com/users/mscuthbert/followers","following_url":"https://api.github.com/users/mscuthbert/following{/other_user}","gists_url":"https://api.github.com/users/mscuthbert/gists{/gist_id}","starred_url":"https://api.github.com/users/mscuthbert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mscuthbert/subscriptions","organizations_url":"https://api.github.com/users/mscuthbert/orgs","repos_url":"https://api.github.com/users/mscuthbert/repos","events_url":"https://api.github.com/users/mscuthbert/events{/privacy}","received_events_url":"https://api.github.com/users/mscuthbert/received_events","type":"User","site_admin":false},"created_at":"2017-07-25T18:17:08Z","updated_at":"2017-07-25T18:17:08Z","body":"I've looked all through the MEI guidelines and except for one example that assumes this usage implicitly, I can't find any discussion of what a note without accidental but w/ a key signature does."}}
{"actor":{"display_login":"mscuthbert"}}