{"action":"created","issue":{"url":"https://api.github.com/repos/alda-lang/alda/issues/9","labels_url":"https://api.github.com/repos/alda-lang/alda/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/alda-lang/alda/issues/9/comments","events_url":"https://api.github.com/repos/alda-lang/alda/issues/9/events","html_url":"https://github.com/alda-lang/alda/issues/9","id":54283084,"number":9,"title":"Implement advanced rhythms","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":[{"url":"https://api.github.com/repos/alda-lang/alda/labels/feature","name":"feature","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2015-01-14T04:30:44Z","updated_at":"2015-10-04T14:48:50Z","closed_at":null,"body":"**Cram**\r\n\r\nI came up with this idea for representing advanced rhythms. I call it \"cram\" because you're basically cramming a bunch of notes inside of a set duration and dividing them up either evenly or according to a weight distribution. \r\n\r\n(**EDIT 9/7/15:** @crisptrutski has a much better idea -- see comments below)\r\nDesired syntax:\r\n\r\n    { d+ c+ < b }2 \r\n\r\nThe above is one way to represent a quarter note triplet -- it's 3 notes crammed into the space of a half note. By default, each note inside the braces is equal in length.\r\n\r\nNotes inside of \"cram brackets\" use a slightly different syntax than usual, in that you don't specify exact note durations like eighth, quarter, etc. Instead, you can (optionally) specify how much weight each crammed note gets, by adding \\*'s to the notes you want to be relatively longer than the others. This can get rather complicated, but here is an simple example:\r\n\r\n    { c* d }4\r\n\r\nThe \"c\" has one \\*, and the \"d\" has none, and they are crammed into the space of a quarter note (4). By default, a note has no \\*, which corresponds to a ratio of 1:1 (i.e. all notes are equal in length). With each \\* that you add, the first number of the ratio increases by one. So what this means is that in the example above, the \"c\" note (c*) has a length ratio of 2:1, whereas the \"d\" note (d) is just 1:1 (technically 1:2, compared to the \"c\" note). Because the \"c\" note is twice as long as the \"d\" note, and the two notes are crammed into the space of a quarter note, the result is two \"swung\" eighths, or in other words, an eighth note triplet where the \"c\" occupies the first two notes, and the \"d\" occupies the third.\r\n\r\nPerhaps an easier way to think about adding \\*'s to notes within cram brackets, is that with each \\* you add, it's like adding another note into the crammed group, only instead of a new note, you're repeating the note you *'d, and then tying them together.\r\n\r\nIt should be possible to include rests and chords inside of cram brackets, too.\r\n\r\n**Second/millisecond durations**\r\n\r\nCome up with some syntax for overriding the beat/tempo model and letting users define exact durations of notes in seconds and milliseconds. Could be as simple as `c60s` (a C lasting 60 seconds), `d+500ms` (a D# lasting 500 milliseconds), etc."},"comment":{"url":"https://api.github.com/repos/alda-lang/alda/issues/comments/145355092","html_url":"https://github.com/alda-lang/alda/issues/9#issuecomment-145355092","issue_url":"https://api.github.com/repos/alda-lang/alda/issues/9","id":145355092,"user":{"login":"crisptrutski","id":881351,"avatar_url":"https://avatars.githubusercontent.com/u/881351?v=3","gravatar_id":"","url":"https://api.github.com/users/crisptrutski","html_url":"https://github.com/crisptrutski","followers_url":"https://api.github.com/users/crisptrutski/followers","following_url":"https://api.github.com/users/crisptrutski/following{/other_user}","gists_url":"https://api.github.com/users/crisptrutski/gists{/gist_id}","starred_url":"https://api.github.com/users/crisptrutski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crisptrutski/subscriptions","organizations_url":"https://api.github.com/users/crisptrutski/orgs","repos_url":"https://api.github.com/users/crisptrutski/repos","events_url":"https://api.github.com/users/crisptrutski/events{/privacy}","received_events_url":"https://api.github.com/users/crisptrutski/received_events","type":"User","site_admin":false},"created_at":"2015-10-04T14:48:50Z","updated_at":"2015-10-04T14:48:50Z","body":"This is the part where I curse you for making `alda.lisp` global side effect based :P"}}