{"action":"created","issue":{"url":"https://api.github.com/repos/daveyarwood/music-theory/issues/2","labels_url":"https://api.github.com/repos/daveyarwood/music-theory/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/daveyarwood/music-theory/issues/2/comments","events_url":"https://api.github.com/repos/daveyarwood/music-theory/issues/2/events","html_url":"https://github.com/daveyarwood/music-theory/issues/2","id":113601091,"number":2,"title":"Alternate tuning systems","user":{"login":"daveyarwood","id":4909079,"avatar_url":"https://avatars.githubusercontent.com/u/4909079?v=3","gravatar_id":"","url":"https://api.github.com/users/daveyarwood","html_url":"https://github.com/daveyarwood","followers_url":"https://api.github.com/users/daveyarwood/followers","following_url":"https://api.github.com/users/daveyarwood/following{/other_user}","gists_url":"https://api.github.com/users/daveyarwood/gists{/gist_id}","starred_url":"https://api.github.com/users/daveyarwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daveyarwood/subscriptions","organizations_url":"https://api.github.com/users/daveyarwood/orgs","repos_url":"https://api.github.com/users/daveyarwood/repos","events_url":"https://api.github.com/users/daveyarwood/events{/privacy}","received_events_url":"https://api.github.com/users/daveyarwood/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-27T14:45:59Z","updated_at":"2016-01-09T16:20:47Z","closed_at":null,"body":"For equal-temperament tuning with a reference pitch other than A440, we can just bind `*reference-pitch*` to the frequency of A4. We can provide a `tune!` function that will use `alter-var-root` to change the `*reference-pitch*`, and a `with-reference-pitch` function/macro that executes the body, binding `*reference-pitch*` to a particular value. (**EDIT 10/28:** done)\r\n\r\nWill have to think a little more about how to handle other kinds of tunings (just, well, Pythagorean, etc.) It would be nice to have them built-in, so you can do something like `(with-tuning :pythagorean (note->hz \"A4\"))`, but currently all the formulas are for equal-temperament tuning. Maybe we could add a `*tuning-system*` var that the `*->hz` functions will consider, and add logic to the functions so that they use the right formula for the current tuning."},"comment":{"url":"https://api.github.com/repos/daveyarwood/music-theory/issues/comments/170257367","html_url":"https://github.com/daveyarwood/music-theory/issues/2#issuecomment-170257367","issue_url":"https://api.github.com/repos/daveyarwood/music-theory/issues/2","id":170257367,"user":{"login":"daveyarwood","id":4909079,"avatar_url":"https://avatars.githubusercontent.com/u/4909079?v=3","gravatar_id":"","url":"https://api.github.com/users/daveyarwood","html_url":"https://github.com/daveyarwood","followers_url":"https://api.github.com/users/daveyarwood/followers","following_url":"https://api.github.com/users/daveyarwood/following{/other_user}","gists_url":"https://api.github.com/users/daveyarwood/gists{/gist_id}","starred_url":"https://api.github.com/users/daveyarwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daveyarwood/subscriptions","organizations_url":"https://api.github.com/users/daveyarwood/orgs","repos_url":"https://api.github.com/users/daveyarwood/repos","events_url":"https://api.github.com/users/daveyarwood/events{/privacy}","received_events_url":"https://api.github.com/users/daveyarwood/received_events","type":"User","site_admin":false},"created_at":"2016-01-09T16:20:47Z","updated_at":"2016-01-09T16:20:47Z","body":"`with-tuning`, `*tuning-system*` etc. are all set up so that we can add other tunings with relative ease. For each tuning, we just need to add its formula to the case statementss in `hz->midi` and `midi->hz`.\r\n\r\nTODO:\r\n\r\n- [ ] well\r\n- [ ] just (a.k.a. harmonic tuning, Helmholtz's scale)\r\n- [ ] mean-tone (seems like there are a lot of variations on this -- quarter-comma meantone, etc.)\r\n- [ ] Pythagorean\r\n- [ ] Werckmeister (there may be multiple ones)"}}