start fleshing out effects chapter

This commit is contained in:
Felix Roos 2023-05-28 12:42:24 +02:00
parent d2dffe3186
commit 1e9979ae18
2 changed files with 181 additions and 20 deletions

View file

@ -7,15 +7,175 @@ import { MiniRepl } from '../../docs/MiniRepl';
# First Effects
import Box from '@components/Box.astro';
We have sounds, we have notes, now let's look at effects!
**low-pass filter with lpf**
<MiniRepl
hideHeader
client:load
tune={`note("<[c2 c3]*4 [bb1 bb2]*4 [f2 f3]*4 [eb2 eb3]*4>/2")
.sound("sawtooth").lpf(800)`}
/>
<Box>
- Change lpf to 200. Notice how it gets muffled. Think of it as standing in front of the club with the door closed 🚪.
- Now let's open the door... change it to 8000. Notice how it gets sharper 🪩
</Box>
**automate the filter**
<MiniRepl
hideHeader
client:load
tune={`note("<[c2 c3]*4 [bb1 bb2]*4 [f2 f3]*4 [eb2 eb3]*4>/2")
.sound("sawtooth").lpf("200 1000")`}
/>
<Box>
- Try adding more values
- Notice how the pattern in lpf does not change the overall rhythm
</Box>
**vowel**
<MiniRepl hideHeader client:load tune={`sound("drum drum drum drum").vowel("a o")`} />
<MiniRepl
hideHeader
client:load
tune={`note("<[c3,g3,e4] [bb2,f3,d4] [a2,f3,c4] [bb2,g3,eb4]>/2")
.sound("sawtooth").vowel("<a e i o>/2")`}
/>
You can probably think of more vowels :)
<Box>
- Try adding more values
- Notice how the pattern in lpf does not change the overall rhythm
</Box>
**gain**
<MiniRepl hideHeader client:load tune={`sound("bd hh sn:1 hh sn:1 hh").gain("1 .5 .2")`} />
<MiniRepl
hideHeader
client:load
tune={`stack(
sound("hh*8").gain("[.25 1]*2"),
sound("bd*2,~ rim")
) `}
/>
<Box>
Rhythm is all about dynamics!
Remove the gain and notice how flat it sounds.
</Box>
**stacks within stacks**
Let's combine all of the above into a little tune:
<MiniRepl
hideHeader
client:load
tune={`stack(
stack(
sound("hh*8").gain("[.25 1]*2"),
sound("bd*2,~ rim")
),
note("<[c2 c3]*4 [bb1 bb2]*4 [f2 f3]*4 [eb2 eb3]*4>/2")
.sound("sawtooth").lpf("200 1000"),
note("<[c3,g3,e4] [bb2,f3,d4] [a2,f3,c4] [bb2,g3,eb4]>/2")
.sound("sawtooth").vowel("<a e i o>/2")
) `}
/>
<Box>
Pay attention to where the commas are and identify the individual parts of the stacks.
The 3 parts (drums, bassline, chords) are exactly as earlier, just stacked together.
</Box>
**fast and slow**
We can use `fast` and `slow` to change the tempo of a pattern outside of Mini-Notation:
<MiniRepl hideHeader client:load tune={`sound("bd*2,~ rim").slow(2)`} />
<Box>
Change the `slow` value. Try replacing it with `fast`.
What happens if you use a pattern like `"<1 [2 4]>"`?
</Box>
By the way, inside Mini-Notation, `fast` is `*` and slow is `/`.
<MiniRepl hideHeader client:load tune={`sound("[bd*2,~ rim]*<1 [2 4]>")`} />
**delay**
<MiniRepl
hideHeader
client:load
tune={`stack(
note("~ [<[d3,a3,f4]!2 [d3,bb3,g4]!2> ~]")
.sound("gm_electric_guitar_muted"),
sound("<bd rim>").bank("RolandTR707")
).delay(".5")`}
/>
<Box>
Try some `delay` values between 0 and 1. Btw, `.5` is short for `0.5`
What happens if you use `.delay(".8:.125")` ? Can you guess what the second number does?
What happens if you use `.delay(".8:.06:.8")` ? Can you guess what the third number does?
</Box>
**room**
<MiniRepl
hideHeader
client:load
tune={`n("<4 [3@3 4] [<2 0> ~@16] ~>/2")
.scale("D4:minor").sound("gm_accordion:2")
.room(2)`}
/>
<Box>
Try different values!
Add a delay too!
</Box>
**little dub tune**
<MiniRepl
hideHeader
client:load
tune={`stack(
note("~ [<[d3,a3,f4]!2 [d3,bb3,g4]!2> ~]")
.sound("gm_electric_guitar_muted"),
sound("<bd rim>").bank("RolandTR707"),
n("<4 [3@3 4] [<2 0> ~@16] ~>/2")
.scale("D4:minor").sound("gm_accordion:2")
.room(2).gain(.5)
).delay(.5)`}
/>
**control the gain with a sine wave**