kylestetz / slang

🎤 a simple audio programming language implemented in JS
http://slang.kylestetz.com
ISC License
1.19k stars 31 forks source link

Improve documentation around Rhythm values #7

Closed voliva closed 5 years ago

voliva commented 5 years ago

I see that to specify a Rhythm we can either use absolute values (time in seconds) or a kind of rhythmic notation, which is an integer + n or t

I see it has to do with compound times, and by testing it, I saw that #n represents a time span of 2/# seconds, and #t represents a time span of 4/(3#) seconds. So if we have a 4t and a 2n, the first one will make 3 beats for every beat of the second one.

However, I can't figure out what's the logic behind this, or I can't find any reference on this notation (I don't know how is it called). Or also why we don't have a 2t or 1t. It would be good to have a bit more documentation around this.

kylestetz commented 5 years ago

All great points, I will take a pass at this and hopefully shed some light on the notation!

kylestetz commented 5 years ago

Okay! You've got a new section called Rhythm and Note Values. I'm closing this issue for now but please let me know what you think and if there are ways this section can be improved.

✌️

kylestetz commented 5 years ago

Oh, and as to why we don't have 2t or 1t ... there's no specific reason! I wanted everything to subdivide neatly into 1n. I'll add 2t, that's a good idea 😄

kylestetz commented 5 years ago

Cool now you have 2t as an option, and the docs have been updated to add that value.

voliva commented 5 years ago

Perfect, that's a great explanation, thank you very much!

However, I think I found a typo here:

for example 4n 4n 4n 4n, 4n 8n 8n 4n 2n, and 4n 16t 16t 16t 8n 4t 4t 4t all add up to 1n.

I think 4n 8n 8n 4n 2n doesn't add up to 1n. Maybe you meant 4n 8n 8n 2n?

kylestetz commented 5 years ago

Ha you're totally right. Nice catch!