mirror of
https://codeberg.org/uzu/strudel
synced 2026-08-18 18:27:49 -04:00
docs: use note instead of n to mitigate confusion
This commit is contained in:
@@ -60,7 +60,7 @@ s("bd,[~ <sd!3 sd(3,4,2)>],hh*8") // drums
|
||||
.off(1/8,x=>x.add(12).degradeBy(.5)) // random octave jumps
|
||||
.add(perlin.range(0,.5)) // random pitch variation
|
||||
.superimpose(add(.05)) // add second, slightly detuned voice
|
||||
.n() // wrap in "n"
|
||||
.note() // wrap in "note"
|
||||
.decay(.15).sustain(0) // make each note of equal length
|
||||
.s('sawtooth') // waveform
|
||||
.gain(.4) // turn down
|
||||
@@ -68,7 +68,7 @@ s("bd,[~ <sd!3 sd(3,4,2)>],hh*8") // drums
|
||||
,"<Am7!3 <Em7 E7b13 Em7 Ebm7b5>>".voicings('lefthand') // chords
|
||||
.superimpose(x=>x.add(.04)) // add second, slightly detuned voice
|
||||
.add(perlin.range(0,.5)) // random pitch variation
|
||||
.n() // wrap in "n"
|
||||
.note() // wrap in "note"
|
||||
.s('sawtooth') // waveform
|
||||
.gain(.16) // turn down
|
||||
.cutoff(500) // fixed cutoff
|
||||
|
||||
@@ -20,15 +20,17 @@ You can learn more about both of these approaches in the pages [Synths](/learn/s
|
||||
|
||||
# Combining notes and sounds
|
||||
|
||||
In both of the above cases, we are no longer directly controlling the `note`/`n`/`freq` of the sound heard via `s`, as we were in the [Notes](/strudel/notes) page.
|
||||
In both of the above cases, we are no longer directly controlling the `note`/`freq` of the sound heard via `s`, as we were in the [Notes](/strudel/notes) page.
|
||||
|
||||
So how can we both control the sound and the pitch? We can _combine_ `note`/`n`/`freq` with `s` to change the sound of our pitches:
|
||||
So how can we both control the sound and the pitch? We can _combine_ `note`/`freq` with `s` to change the sound of our pitches:
|
||||
|
||||
<MiniRepl client:idle tune={`note("a3 c#4 e4 a4").s("sawtooth")`} />
|
||||
|
||||
<MiniRepl client:idle tune={`n("57 61 64 69").s("triangle")`} />
|
||||
<MiniRepl client:idle tune={`note("57 61 64 69").s("sine")`} />
|
||||
|
||||
<MiniRepl client:idle tune={`freq("220 275 330 440").s("sine")`} />
|
||||
<MiniRepl client:idle tune={`freq("220 275 330 440").s("triangle")`} />
|
||||
|
||||
The last example will actually sound the same with or without `s`, because `triangle` is the default value for `s`.
|
||||
|
||||
What about combining different notes with different sounds at the same time?
|
||||
|
||||
@@ -37,5 +39,3 @@ What about combining different notes with different sounds at the same time?
|
||||
Hmm, something interesting is going on there, related to there being five notes and three sounds.
|
||||
|
||||
Let's now take a step back and think about the Strudel [Code](/learn/code) we've been hearing so far.
|
||||
|
||||
<br />
|
||||
|
||||
Reference in New Issue
Block a user