{"action":"closed","issue":{"url":"https://api.github.com/repos/stuartkeith/esq1/issues/1","repository_url":"https://api.github.com/repos/stuartkeith/esq1","labels_url":"https://api.github.com/repos/stuartkeith/esq1/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/stuartkeith/esq1/issues/1/comments","events_url":"https://api.github.com/repos/stuartkeith/esq1/issues/1/events","html_url":"https://github.com/stuartkeith/esq1/issues/1","id":132739704,"number":1,"title":"Small bug in LFO mod source serialization/deserialization","user":{"login":"coffeeshopped","id":557851,"avatar_url":"https://avatars.githubusercontent.com/u/557851?v=3","gravatar_id":"","url":"https://api.github.com/users/coffeeshopped","html_url":"https://github.com/coffeeshopped","followers_url":"https://api.github.com/users/coffeeshopped/followers","following_url":"https://api.github.com/users/coffeeshopped/following{/other_user}","gists_url":"https://api.github.com/users/coffeeshopped/gists{/gist_id}","starred_url":"https://api.github.com/users/coffeeshopped/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coffeeshopped/subscriptions","organizations_url":"https://api.github.com/users/coffeeshopped/orgs","repos_url":"https://api.github.com/users/coffeeshopped/repos","events_url":"https://api.github.com/users/coffeeshopped/events{/privacy}","received_events_url":"https://api.github.com/users/coffeeshopped/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-10T15:58:38Z","updated_at":"2016-02-13T15:04:16Z","closed_at":"2016-02-13T15:04:16Z","body":"In my tests, it looks like the pairs of bits that get broken up for the mod source of an LFO are swapped, so that serialized patches are corrupting that parameter. You just need to swap what you're doing with your modulation_source_0 and modulation_source_1 variables in serialize and deserialize. So, here: https://github.com/stuartkeith/esq1/blob/master/esq1.py#L312\r\n\r\nChange those two lines to:\r\n\r\n        bytes.append(modulation_source_1 + self.levels[0].value)\r\n        bytes.append(modulation_source_0 + self.levels[1].value)\r\n\r\n... and in deserialize (https://github.com/stuartkeith/esq1/blob/master/esq1.py#L335):\r\n\r\n        self.modulation_source.value = modulation_source_1 +\\\r\n            (modulation_source_0 << 2)\r\n\r\nThat fixes it for me.\r\n\r\nI'm building an ESQ-1 editor of my own, so thanks for this wonderful example!"}}