bring back division

This commit is contained in:
Felix Roos 2024-04-11 11:40:18 +02:00
parent a3bd04732c
commit 83eedcb2f5

View File

@ -145,6 +145,20 @@ We will see more ways to combine patterns later..
## Longer Sequences
**Divide sequences with `/` to slow them down**
<MiniRepl client:visible tune={`note("[36 34 41 39]/4").sound("gm_acoustic_bass")`} punchcard />
<Box>
The `/4` plays the sequence in brackets over 4 cycles (=8s).
So each of the 4 notes is 2s long.
Try adding more notes inside the brackets and notice how it gets faster.
</Box>
**Play one per cycle with `< ... >`**
In the last section, we learned that `< ... >` (angle brackets) can be used to play only one thing per cycle,
@ -156,6 +170,8 @@ which is useful for longer melodies too:
Try adding more notes inside the brackets and notice how the tempo stays the same.
The angle brackets are actually just a shortcut for `[...]/x` where `x` is the number of elements inside the brackets!
</Box>
**Play one sequence per cycle**
@ -285,6 +301,7 @@ Let's recap what we've learned in this chapter:
| Concept | Syntax | Example |
| --------- | ------ | -------------------------------------------------------- |
| Slow down | \/ | <MiniRepl client:visible tune={`note("[c a f e]/2")`} /> |
| Alternate | \<\> | <MiniRepl client:visible tune={`note("c a f <e g>")`} /> |
| Elongate | @ | <MiniRepl client:visible tune={`note("c@3 e")`} /> |
| Replicate | ! | <MiniRepl client:visible tune={`note("c!3 e")`} /> |