Merge pull request #1122 from tidalcycles/migrate-tutorial-fanchor

Migrate tutorial fanchor
This commit is contained in:
Felix Roos 2024-05-31 12:17:34 +02:00 committed by GitHub
commit 3ce32438d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 117 additions and 108 deletions

View file

@ -553,7 +553,7 @@ export const { cutoff, ctf, lpf, lp } = registerControl(['cutoff', 'resonance',
* @example * @example
* note("c2 e2 f2 g2") * note("c2 e2 f2 g2")
* .sound('sawtooth') * .sound('sawtooth')
* .lpf(500) * .lpf(300)
* .lpa(.5) * .lpa(.5)
* .lpenv("<4 2 1 0 -1 -2 -4>/4") * .lpenv("<4 2 1 0 -1 -2 -4>/4")
*/ */
@ -592,7 +592,7 @@ export const { bpenv, bpe } = registerControl('bpenv', 'bpe');
* @example * @example
* note("c2 e2 f2 g2") * note("c2 e2 f2 g2")
* .sound('sawtooth') * .sound('sawtooth')
* .lpf(500) * .lpf(300)
* .lpa("<.5 .25 .1 .01>/4") * .lpa("<.5 .25 .1 .01>/4")
* .lpenv(4) * .lpenv(4)
*/ */
@ -631,9 +631,8 @@ export const { bpattack, bpa } = registerControl('bpattack', 'bpa');
* @example * @example
* note("c2 e2 f2 g2") * note("c2 e2 f2 g2")
* .sound('sawtooth') * .sound('sawtooth')
* .lpf(500) * .lpf(300)
* .lpd("<.5 .25 .1 0>/4") * .lpd("<.5 .25 .1 0>/4")
* .lps(0.2)
* .lpenv(4) * .lpenv(4)
*/ */
export const { lpdecay, lpd } = registerControl('lpdecay', 'lpd'); export const { lpdecay, lpd } = registerControl('lpdecay', 'lpd');
@ -673,7 +672,7 @@ export const { bpdecay, bpd } = registerControl('bpdecay', 'bpd');
* @example * @example
* note("c2 e2 f2 g2") * note("c2 e2 f2 g2")
* .sound('sawtooth') * .sound('sawtooth')
* .lpf(500) * .lpf(300)
* .lpd(.5) * .lpd(.5)
* .lps("<0 .25 .5 1>/4") * .lps("<0 .25 .5 1>/4")
* .lpenv(4) * .lpenv(4)
@ -716,7 +715,7 @@ export const { bpsustain, bps } = registerControl('bpsustain', 'bps');
* note("c2 e2 f2 g2") * note("c2 e2 f2 g2")
* .sound('sawtooth') * .sound('sawtooth')
* .clip(.5) * .clip(.5)
* .lpf(500) * .lpf(300)
* .lpenv(4) * .lpenv(4)
* .lpr("<.5 .25 .1 0>/4") * .lpr("<.5 .25 .1 0>/4")
* .release(.5) * .release(.5)

View file

@ -4060,64 +4060,64 @@ exports[`runs examples > example "loopEnd" example index 0 1`] = `
exports[`runs examples > example "lpattack" example index 0 1`] = ` exports[`runs examples > example "lpattack" example index 0 1`] = `
[ [
"[ 0/1 → 1/4 | note:c2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", "[ 0/1 → 1/4 | note:c2 s:sawtooth cutoff:300 lpattack:0.5 lpenv:4 ]",
"[ 1/4 → 1/2 | note:e2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", "[ 1/4 → 1/2 | note:e2 s:sawtooth cutoff:300 lpattack:0.5 lpenv:4 ]",
"[ 1/2 → 3/4 | note:f2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", "[ 1/2 → 3/4 | note:f2 s:sawtooth cutoff:300 lpattack:0.5 lpenv:4 ]",
"[ 3/4 → 1/1 | note:g2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", "[ 3/4 → 1/1 | note:g2 s:sawtooth cutoff:300 lpattack:0.5 lpenv:4 ]",
"[ 1/1 → 5/4 | note:c2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", "[ 1/1 → 5/4 | note:c2 s:sawtooth cutoff:300 lpattack:0.5 lpenv:4 ]",
"[ 5/4 → 3/2 | note:e2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", "[ 5/4 → 3/2 | note:e2 s:sawtooth cutoff:300 lpattack:0.5 lpenv:4 ]",
"[ 3/2 → 7/4 | note:f2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", "[ 3/2 → 7/4 | note:f2 s:sawtooth cutoff:300 lpattack:0.5 lpenv:4 ]",
"[ 7/4 → 2/1 | note:g2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", "[ 7/4 → 2/1 | note:g2 s:sawtooth cutoff:300 lpattack:0.5 lpenv:4 ]",
"[ 2/1 → 9/4 | note:c2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", "[ 2/1 → 9/4 | note:c2 s:sawtooth cutoff:300 lpattack:0.5 lpenv:4 ]",
"[ 9/4 → 5/2 | note:e2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", "[ 9/4 → 5/2 | note:e2 s:sawtooth cutoff:300 lpattack:0.5 lpenv:4 ]",
"[ 5/2 → 11/4 | note:f2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", "[ 5/2 → 11/4 | note:f2 s:sawtooth cutoff:300 lpattack:0.5 lpenv:4 ]",
"[ 11/4 → 3/1 | note:g2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", "[ 11/4 → 3/1 | note:g2 s:sawtooth cutoff:300 lpattack:0.5 lpenv:4 ]",
"[ 3/1 → 13/4 | note:c2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", "[ 3/1 → 13/4 | note:c2 s:sawtooth cutoff:300 lpattack:0.5 lpenv:4 ]",
"[ 13/4 → 7/2 | note:e2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", "[ 13/4 → 7/2 | note:e2 s:sawtooth cutoff:300 lpattack:0.5 lpenv:4 ]",
"[ 7/2 → 15/4 | note:f2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", "[ 7/2 → 15/4 | note:f2 s:sawtooth cutoff:300 lpattack:0.5 lpenv:4 ]",
"[ 15/4 → 4/1 | note:g2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", "[ 15/4 → 4/1 | note:g2 s:sawtooth cutoff:300 lpattack:0.5 lpenv:4 ]",
] ]
`; `;
exports[`runs examples > example "lpdecay" example index 0 1`] = ` exports[`runs examples > example "lpdecay" example index 0 1`] = `
[ [
"[ 0/1 → 1/4 | note:c2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0.2 lpenv:4 ]", "[ 0/1 → 1/4 | note:c2 s:sawtooth cutoff:300 lpdecay:0.5 lpenv:4 ]",
"[ 1/4 → 1/2 | note:e2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0.2 lpenv:4 ]", "[ 1/4 → 1/2 | note:e2 s:sawtooth cutoff:300 lpdecay:0.5 lpenv:4 ]",
"[ 1/2 → 3/4 | note:f2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0.2 lpenv:4 ]", "[ 1/2 → 3/4 | note:f2 s:sawtooth cutoff:300 lpdecay:0.5 lpenv:4 ]",
"[ 3/4 → 1/1 | note:g2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0.2 lpenv:4 ]", "[ 3/4 → 1/1 | note:g2 s:sawtooth cutoff:300 lpdecay:0.5 lpenv:4 ]",
"[ 1/1 → 5/4 | note:c2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0.2 lpenv:4 ]", "[ 1/1 → 5/4 | note:c2 s:sawtooth cutoff:300 lpdecay:0.5 lpenv:4 ]",
"[ 5/4 → 3/2 | note:e2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0.2 lpenv:4 ]", "[ 5/4 → 3/2 | note:e2 s:sawtooth cutoff:300 lpdecay:0.5 lpenv:4 ]",
"[ 3/2 → 7/4 | note:f2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0.2 lpenv:4 ]", "[ 3/2 → 7/4 | note:f2 s:sawtooth cutoff:300 lpdecay:0.5 lpenv:4 ]",
"[ 7/4 → 2/1 | note:g2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0.2 lpenv:4 ]", "[ 7/4 → 2/1 | note:g2 s:sawtooth cutoff:300 lpdecay:0.5 lpenv:4 ]",
"[ 2/1 → 9/4 | note:c2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0.2 lpenv:4 ]", "[ 2/1 → 9/4 | note:c2 s:sawtooth cutoff:300 lpdecay:0.5 lpenv:4 ]",
"[ 9/4 → 5/2 | note:e2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0.2 lpenv:4 ]", "[ 9/4 → 5/2 | note:e2 s:sawtooth cutoff:300 lpdecay:0.5 lpenv:4 ]",
"[ 5/2 → 11/4 | note:f2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0.2 lpenv:4 ]", "[ 5/2 → 11/4 | note:f2 s:sawtooth cutoff:300 lpdecay:0.5 lpenv:4 ]",
"[ 11/4 → 3/1 | note:g2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0.2 lpenv:4 ]", "[ 11/4 → 3/1 | note:g2 s:sawtooth cutoff:300 lpdecay:0.5 lpenv:4 ]",
"[ 3/1 → 13/4 | note:c2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0.2 lpenv:4 ]", "[ 3/1 → 13/4 | note:c2 s:sawtooth cutoff:300 lpdecay:0.5 lpenv:4 ]",
"[ 13/4 → 7/2 | note:e2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0.2 lpenv:4 ]", "[ 13/4 → 7/2 | note:e2 s:sawtooth cutoff:300 lpdecay:0.5 lpenv:4 ]",
"[ 7/2 → 15/4 | note:f2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0.2 lpenv:4 ]", "[ 7/2 → 15/4 | note:f2 s:sawtooth cutoff:300 lpdecay:0.5 lpenv:4 ]",
"[ 15/4 → 4/1 | note:g2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0.2 lpenv:4 ]", "[ 15/4 → 4/1 | note:g2 s:sawtooth cutoff:300 lpdecay:0.5 lpenv:4 ]",
] ]
`; `;
exports[`runs examples > example "lpenv" example index 0 1`] = ` exports[`runs examples > example "lpenv" example index 0 1`] = `
[ [
"[ 0/1 → 1/4 | note:c2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", "[ 0/1 → 1/4 | note:c2 s:sawtooth cutoff:300 lpattack:0.5 lpenv:4 ]",
"[ 1/4 → 1/2 | note:e2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", "[ 1/4 → 1/2 | note:e2 s:sawtooth cutoff:300 lpattack:0.5 lpenv:4 ]",
"[ 1/2 → 3/4 | note:f2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", "[ 1/2 → 3/4 | note:f2 s:sawtooth cutoff:300 lpattack:0.5 lpenv:4 ]",
"[ 3/4 → 1/1 | note:g2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", "[ 3/4 → 1/1 | note:g2 s:sawtooth cutoff:300 lpattack:0.5 lpenv:4 ]",
"[ 1/1 → 5/4 | note:c2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", "[ 1/1 → 5/4 | note:c2 s:sawtooth cutoff:300 lpattack:0.5 lpenv:4 ]",
"[ 5/4 → 3/2 | note:e2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", "[ 5/4 → 3/2 | note:e2 s:sawtooth cutoff:300 lpattack:0.5 lpenv:4 ]",
"[ 3/2 → 7/4 | note:f2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", "[ 3/2 → 7/4 | note:f2 s:sawtooth cutoff:300 lpattack:0.5 lpenv:4 ]",
"[ 7/4 → 2/1 | note:g2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", "[ 7/4 → 2/1 | note:g2 s:sawtooth cutoff:300 lpattack:0.5 lpenv:4 ]",
"[ 2/1 → 9/4 | note:c2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", "[ 2/1 → 9/4 | note:c2 s:sawtooth cutoff:300 lpattack:0.5 lpenv:4 ]",
"[ 9/4 → 5/2 | note:e2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", "[ 9/4 → 5/2 | note:e2 s:sawtooth cutoff:300 lpattack:0.5 lpenv:4 ]",
"[ 5/2 → 11/4 | note:f2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", "[ 5/2 → 11/4 | note:f2 s:sawtooth cutoff:300 lpattack:0.5 lpenv:4 ]",
"[ 11/4 → 3/1 | note:g2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", "[ 11/4 → 3/1 | note:g2 s:sawtooth cutoff:300 lpattack:0.5 lpenv:4 ]",
"[ 3/1 → 13/4 | note:c2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", "[ 3/1 → 13/4 | note:c2 s:sawtooth cutoff:300 lpattack:0.5 lpenv:4 ]",
"[ 13/4 → 7/2 | note:e2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", "[ 13/4 → 7/2 | note:e2 s:sawtooth cutoff:300 lpattack:0.5 lpenv:4 ]",
"[ 7/2 → 15/4 | note:f2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", "[ 7/2 → 15/4 | note:f2 s:sawtooth cutoff:300 lpattack:0.5 lpenv:4 ]",
"[ 15/4 → 4/1 | note:g2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", "[ 15/4 → 4/1 | note:g2 s:sawtooth cutoff:300 lpattack:0.5 lpenv:4 ]",
] ]
`; `;
@ -4290,43 +4290,43 @@ exports[`runs examples > example "lpq" example index 0 1`] = `
exports[`runs examples > example "lprelease" example index 0 1`] = ` exports[`runs examples > example "lprelease" example index 0 1`] = `
[ [
"[ 0/1 → 1/4 | note:c2 s:sawtooth clip:0.5 cutoff:500 lpenv:4 lprelease:0.5 release:0.5 ]", "[ 0/1 → 1/4 | note:c2 s:sawtooth clip:0.5 cutoff:300 lpenv:4 lprelease:0.5 release:0.5 ]",
"[ 1/4 → 1/2 | note:e2 s:sawtooth clip:0.5 cutoff:500 lpenv:4 lprelease:0.5 release:0.5 ]", "[ 1/4 → 1/2 | note:e2 s:sawtooth clip:0.5 cutoff:300 lpenv:4 lprelease:0.5 release:0.5 ]",
"[ 1/2 → 3/4 | note:f2 s:sawtooth clip:0.5 cutoff:500 lpenv:4 lprelease:0.5 release:0.5 ]", "[ 1/2 → 3/4 | note:f2 s:sawtooth clip:0.5 cutoff:300 lpenv:4 lprelease:0.5 release:0.5 ]",
"[ 3/4 → 1/1 | note:g2 s:sawtooth clip:0.5 cutoff:500 lpenv:4 lprelease:0.5 release:0.5 ]", "[ 3/4 → 1/1 | note:g2 s:sawtooth clip:0.5 cutoff:300 lpenv:4 lprelease:0.5 release:0.5 ]",
"[ 1/1 → 5/4 | note:c2 s:sawtooth clip:0.5 cutoff:500 lpenv:4 lprelease:0.5 release:0.5 ]", "[ 1/1 → 5/4 | note:c2 s:sawtooth clip:0.5 cutoff:300 lpenv:4 lprelease:0.5 release:0.5 ]",
"[ 5/4 → 3/2 | note:e2 s:sawtooth clip:0.5 cutoff:500 lpenv:4 lprelease:0.5 release:0.5 ]", "[ 5/4 → 3/2 | note:e2 s:sawtooth clip:0.5 cutoff:300 lpenv:4 lprelease:0.5 release:0.5 ]",
"[ 3/2 → 7/4 | note:f2 s:sawtooth clip:0.5 cutoff:500 lpenv:4 lprelease:0.5 release:0.5 ]", "[ 3/2 → 7/4 | note:f2 s:sawtooth clip:0.5 cutoff:300 lpenv:4 lprelease:0.5 release:0.5 ]",
"[ 7/4 → 2/1 | note:g2 s:sawtooth clip:0.5 cutoff:500 lpenv:4 lprelease:0.5 release:0.5 ]", "[ 7/4 → 2/1 | note:g2 s:sawtooth clip:0.5 cutoff:300 lpenv:4 lprelease:0.5 release:0.5 ]",
"[ 2/1 → 9/4 | note:c2 s:sawtooth clip:0.5 cutoff:500 lpenv:4 lprelease:0.5 release:0.5 ]", "[ 2/1 → 9/4 | note:c2 s:sawtooth clip:0.5 cutoff:300 lpenv:4 lprelease:0.5 release:0.5 ]",
"[ 9/4 → 5/2 | note:e2 s:sawtooth clip:0.5 cutoff:500 lpenv:4 lprelease:0.5 release:0.5 ]", "[ 9/4 → 5/2 | note:e2 s:sawtooth clip:0.5 cutoff:300 lpenv:4 lprelease:0.5 release:0.5 ]",
"[ 5/2 → 11/4 | note:f2 s:sawtooth clip:0.5 cutoff:500 lpenv:4 lprelease:0.5 release:0.5 ]", "[ 5/2 → 11/4 | note:f2 s:sawtooth clip:0.5 cutoff:300 lpenv:4 lprelease:0.5 release:0.5 ]",
"[ 11/4 → 3/1 | note:g2 s:sawtooth clip:0.5 cutoff:500 lpenv:4 lprelease:0.5 release:0.5 ]", "[ 11/4 → 3/1 | note:g2 s:sawtooth clip:0.5 cutoff:300 lpenv:4 lprelease:0.5 release:0.5 ]",
"[ 3/1 → 13/4 | note:c2 s:sawtooth clip:0.5 cutoff:500 lpenv:4 lprelease:0.5 release:0.5 ]", "[ 3/1 → 13/4 | note:c2 s:sawtooth clip:0.5 cutoff:300 lpenv:4 lprelease:0.5 release:0.5 ]",
"[ 13/4 → 7/2 | note:e2 s:sawtooth clip:0.5 cutoff:500 lpenv:4 lprelease:0.5 release:0.5 ]", "[ 13/4 → 7/2 | note:e2 s:sawtooth clip:0.5 cutoff:300 lpenv:4 lprelease:0.5 release:0.5 ]",
"[ 7/2 → 15/4 | note:f2 s:sawtooth clip:0.5 cutoff:500 lpenv:4 lprelease:0.5 release:0.5 ]", "[ 7/2 → 15/4 | note:f2 s:sawtooth clip:0.5 cutoff:300 lpenv:4 lprelease:0.5 release:0.5 ]",
"[ 15/4 → 4/1 | note:g2 s:sawtooth clip:0.5 cutoff:500 lpenv:4 lprelease:0.5 release:0.5 ]", "[ 15/4 → 4/1 | note:g2 s:sawtooth clip:0.5 cutoff:300 lpenv:4 lprelease:0.5 release:0.5 ]",
] ]
`; `;
exports[`runs examples > example "lpsustain" example index 0 1`] = ` exports[`runs examples > example "lpsustain" example index 0 1`] = `
[ [
"[ 0/1 → 1/4 | note:c2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0 lpenv:4 ]", "[ 0/1 → 1/4 | note:c2 s:sawtooth cutoff:300 lpdecay:0.5 lpsustain:0 lpenv:4 ]",
"[ 1/4 → 1/2 | note:e2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0 lpenv:4 ]", "[ 1/4 → 1/2 | note:e2 s:sawtooth cutoff:300 lpdecay:0.5 lpsustain:0 lpenv:4 ]",
"[ 1/2 → 3/4 | note:f2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0 lpenv:4 ]", "[ 1/2 → 3/4 | note:f2 s:sawtooth cutoff:300 lpdecay:0.5 lpsustain:0 lpenv:4 ]",
"[ 3/4 → 1/1 | note:g2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0 lpenv:4 ]", "[ 3/4 → 1/1 | note:g2 s:sawtooth cutoff:300 lpdecay:0.5 lpsustain:0 lpenv:4 ]",
"[ 1/1 → 5/4 | note:c2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0 lpenv:4 ]", "[ 1/1 → 5/4 | note:c2 s:sawtooth cutoff:300 lpdecay:0.5 lpsustain:0 lpenv:4 ]",
"[ 5/4 → 3/2 | note:e2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0 lpenv:4 ]", "[ 5/4 → 3/2 | note:e2 s:sawtooth cutoff:300 lpdecay:0.5 lpsustain:0 lpenv:4 ]",
"[ 3/2 → 7/4 | note:f2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0 lpenv:4 ]", "[ 3/2 → 7/4 | note:f2 s:sawtooth cutoff:300 lpdecay:0.5 lpsustain:0 lpenv:4 ]",
"[ 7/4 → 2/1 | note:g2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0 lpenv:4 ]", "[ 7/4 → 2/1 | note:g2 s:sawtooth cutoff:300 lpdecay:0.5 lpsustain:0 lpenv:4 ]",
"[ 2/1 → 9/4 | note:c2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0 lpenv:4 ]", "[ 2/1 → 9/4 | note:c2 s:sawtooth cutoff:300 lpdecay:0.5 lpsustain:0 lpenv:4 ]",
"[ 9/4 → 5/2 | note:e2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0 lpenv:4 ]", "[ 9/4 → 5/2 | note:e2 s:sawtooth cutoff:300 lpdecay:0.5 lpsustain:0 lpenv:4 ]",
"[ 5/2 → 11/4 | note:f2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0 lpenv:4 ]", "[ 5/2 → 11/4 | note:f2 s:sawtooth cutoff:300 lpdecay:0.5 lpsustain:0 lpenv:4 ]",
"[ 11/4 → 3/1 | note:g2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0 lpenv:4 ]", "[ 11/4 → 3/1 | note:g2 s:sawtooth cutoff:300 lpdecay:0.5 lpsustain:0 lpenv:4 ]",
"[ 3/1 → 13/4 | note:c2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0 lpenv:4 ]", "[ 3/1 → 13/4 | note:c2 s:sawtooth cutoff:300 lpdecay:0.5 lpsustain:0 lpenv:4 ]",
"[ 13/4 → 7/2 | note:e2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0 lpenv:4 ]", "[ 13/4 → 7/2 | note:e2 s:sawtooth cutoff:300 lpdecay:0.5 lpsustain:0 lpenv:4 ]",
"[ 7/2 → 15/4 | note:f2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0 lpenv:4 ]", "[ 7/2 → 15/4 | note:f2 s:sawtooth cutoff:300 lpdecay:0.5 lpsustain:0 lpenv:4 ]",
"[ 15/4 → 4/1 | note:g2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0 lpenv:4 ]", "[ 15/4 → 4/1 | note:g2 s:sawtooth cutoff:300 lpdecay:0.5 lpsustain:0 lpenv:4 ]",
] ]
`; `;

View file

@ -6,15 +6,15 @@ import { transpiler } from '@strudel/transpiler';
import { getAudioContext, webaudioOutput, initAudioOnFirstClick } from '@strudel/webaudio'; import { getAudioContext, webaudioOutput, initAudioOnFirstClick } from '@strudel/webaudio';
import { StrudelMirror } from '@strudel/codemirror'; import { StrudelMirror } from '@strudel/codemirror';
import { prebake } from '../repl/prebake.mjs'; import { prebake } from '../repl/prebake.mjs';
import { loadModules } from '../repl/util.mjs'; import { loadModules, setVersionDefaultsFrom } from '../repl/util.mjs';
import Claviature from '@components/Claviature'; import Claviature from '@components/Claviature';
import useClient from '@src/useClient.mjs'; import useClient from '@src/useClient.mjs';
let prebaked, modulesLoading, audioLoading; let prebaked, modulesLoading, audioReady;
if (typeof window !== 'undefined') { if (typeof window !== 'undefined') {
prebaked = prebake(); prebaked = prebake();
modulesLoading = loadModules(); modulesLoading = loadModules();
audioLoading = initAudioOnFirstClick(); audioReady = initAudioOnFirstClick();
} }
export function MiniRepl({ export function MiniRepl({
@ -69,10 +69,12 @@ export function MiniRepl({
} }
return pat; return pat;
}, },
prebake: async () => Promise.all([modulesLoading, prebaked, audioLoading]), prebake: async () => Promise.all([modulesLoading, prebaked]),
onUpdateState: (state) => { onUpdateState: (state) => {
setReplState({ ...state }); setReplState({ ...state });
}, },
beforeEval: () => audioReady, // not doing this in prebake to make sure viz is drawn
afterEval: ({ code }) => setVersionDefaultsFrom(code),
}); });
// init settings // init settings
editor.setCode(code); editor.setCode(code);

View file

@ -1,5 +1,6 @@
export const examples = [ export const examples = [
`// "coastline" @by eddyflux `// "coastline" @by eddyflux
// @version 1.0
samples('github:eddyflux/crate') samples('github:eddyflux/crate')
setcps(.75) setcps(.75)
let chords = chord("<Bbm9 Fm9>/4").dict('ireal') let chords = chord("<Bbm9 Fm9>/4").dict('ireal')
@ -18,7 +19,7 @@ stack(
n("<0!3 1*2>").set(chords).mode("root:g2") n("<0!3 1*2>").set(chords).mode("root:g2")
.voicing().s("gm_acoustic_bass"), .voicing().s("gm_acoustic_bass"),
chords.n("[0 <4 3 <2 5>>*2](<3 5>,8)") chords.n("[0 <4 3 <2 5>>*2](<3 5>,8)")
.set(x).anchor("D5").voicing() .anchor("D5").voicing()
.segment(4).clip(rand.range(.4,.8)) .segment(4).clip(rand.range(.4,.8))
.room(.75).shape(.3).delay(.25) .room(.75).shape(.3).delay(.25)
.fm(sine.range(3,8).slow(8)) .fm(sine.range(3,8).slow(8))
@ -29,6 +30,7 @@ stack(
) )
.late("[0 .01]*4").late("[0 .01]*2").size(4)`, .late("[0 .01]*4").late("[0 .01]*2").size(4)`,
`// "broken cut 1" @by froos `// "broken cut 1" @by froos
// @version 1.0
samples('github:tidalcycles/dirt-samples') samples('github:tidalcycles/dirt-samples')
samples({ samples({
@ -56,6 +58,7 @@ note("[c2 ~](3,8)*2,eb,g,bb,d").s("sawtooth")
s("<whirl attack>?").delay(".8:.1:.8").room(2).slow(8).cut(2), s("<whirl attack>?").delay(".8:.1:.8").room(2).slow(8).cut(2),
).reset("<x@30 [x*[8 [8 [16 32]]]]@2>".late(2))`, ).reset("<x@30 [x*[8 [8 [16 32]]]]@2>".late(2))`,
`// "acidic tooth" @by eddyflux `// "acidic tooth" @by eddyflux
// @version 1.0
setcps(1) setcps(1)
stack( stack(
note("[<g1 f1>/8](<3 5>,8)") note("[<g1 f1>/8](<3 5>,8)")

View file

@ -94,7 +94,7 @@ Each filter can receive an additional filter envelope controlling the cutoff val
client:idle client:idle
tune={`note("[c eb g <f bb>](3,8,<0 1>)".sub(12)) tune={`note("[c eb g <f bb>](3,8,<0 1>)".sub(12))
.s("<sawtooth>/64") .s("<sawtooth>/64")
.lpf(sine.range(500,3000).slow(16)) .lpf(sine.range(300,2000).slow(16))
.lpa(0.005) .lpa(0.005)
.lpd(perlin.range(.02,.2)) .lpd(perlin.range(.02,.2))
.lps(perlin.range(0,.5).slow(3)) .lps(perlin.range(0,.5).slow(3))
@ -106,7 +106,7 @@ Each filter can receive an additional filter envelope controlling the cutoff val
.juxBy(.5,rev) .juxBy(.5,rev)
.sometimes(add(note(12))) .sometimes(add(note(12)))
.stack(s("bd*2").bank('RolandTR909')) .stack(s("bd*2").bank('RolandTR909'))
.gain(.5)`} .gain(.5).fast(2)`}
/> />
There is one filter envelope for each filter type and thus one set of envelope filter parameters preceded either by `lp`, `hp` or `bp`: There is one filter envelope for each filter type and thus one set of envelope filter parameters preceded either by `lp`, `hp` or `bp`:

View file

@ -308,7 +308,7 @@ Running through different wavetables can also give interesting variations:
<MiniRepl <MiniRepl
client:visible client:visible
tune={`samples('github:bubobubobubobubo/dough-waveforms') tune={`samples('github:bubobubobubobubo/dough-waveforms')
note("c2*8").s("wt_dbass").n(run(8))`} note("c2*8").s("wt_dbass").n(run(8)).fast(2)`}
/> />
...adding a filter envelope + reverb: ...adding a filter envelope + reverb:
@ -317,6 +317,6 @@ note("c2*8").s("wt_dbass").n(run(8))`}
client:visible client:visible
tune={`samples('github:bubobubobubobubo/dough-waveforms') tune={`samples('github:bubobubobubobubo/dough-waveforms')
note("c2*8").s("wt_dbass").n(run(8)) note("c2*8").s("wt_dbass").n(run(8))
.lpf(perlin.range(200,2000).slow(8)) .lpf(perlin.range(100,1000).slow(8))
.lpenv(-3).lpa(.1).room(.5)`} .lpenv(-3).lpa(.1).room(.5).fast(2)`}
/> />

View file

@ -262,7 +262,7 @@ By the way, inside Mini-Notation, `fast` is `*` and `slow` is `/`.
<MiniRepl client:visible tune={`sound("[bd*4,~ rim ~ cp]*<1 [2 4]>")`} /> <MiniRepl client:visible tune={`sound("[bd*4,~ rim ~ cp]*<1 [2 4]>")`} />
## automation with signals ## modulation with signals
Instead of changing values stepwise, we can also control them with signals: Instead of changing values stepwise, we can also control them with signals:
@ -290,7 +290,7 @@ What happens if you flip the range values?
</Box> </Box>
We can change the automation speed with slow / fast: We can change the modulation speed with slow / fast:
<MiniRepl <MiniRepl
client:visible client:visible
@ -301,7 +301,7 @@ We can change the automation speed with slow / fast:
<Box> <Box>
The whole automation will now take 8 cycles to repeat. The whole modulation will now take 8 cycles to repeat.
</Box> </Box>

View file

@ -16,7 +16,7 @@ import {
initAudioOnFirstClick, initAudioOnFirstClick,
} from '@strudel/webaudio'; } from '@strudel/webaudio';
import { defaultAudioDeviceName } from '../settings.mjs'; import { defaultAudioDeviceName } from '../settings.mjs';
import { getAudioDevices, setAudioDevice } from './util.mjs'; import { getAudioDevices, setAudioDevice, setVersionDefaultsFrom } from './util.mjs';
import { StrudelMirror, defaultSettings } from '@strudel/codemirror'; import { StrudelMirror, defaultSettings } from '@strudel/codemirror';
import { clearHydra } from '@strudel/hydra'; import { clearHydra } from '@strudel/hydra';
import { useCallback, useEffect, useRef, useState } from 'react'; import { useCallback, useEffect, useRef, useState } from 'react';
@ -96,13 +96,7 @@ export function Repl({ embedded = false }) {
window.location.hash = '#' + code2hash(code); window.location.hash = '#' + code2hash(code);
setDocumentTitle(code); setDocumentTitle(code);
const viewingPatternData = getViewingPatternData(); const viewingPatternData = getViewingPatternData();
try { setVersionDefaultsFrom(code);
const metadata = getMetadata(code);
setVersionDefaults(metadata.version);
} catch (err) {
console.error('Error parsing metadata..');
console.error(err);
}
const data = { ...viewingPatternData, code }; const data = { ...viewingPatternData, code };
let id = data.id; let id = data.id;
const isExamplePattern = viewingPatternData.collection !== userPattern.collection; const isExamplePattern = viewingPatternData.collection !== userPattern.collection;

View file

@ -1,6 +1,7 @@
import { evalScope, hash2code, logger } from '@strudel/core'; import { evalScope, hash2code, logger } from '@strudel/core';
import { settingPatterns, defaultAudioDeviceName } from '../settings.mjs'; import { settingPatterns, defaultAudioDeviceName } from '../settings.mjs';
import { getAudioContext, initializeAudioOutput, setDefaultAudioContext } from '@strudel/webaudio'; import { getAudioContext, initializeAudioOutput, setDefaultAudioContext, setVersionDefaults } from '@strudel/webaudio';
import { getMetadata } from '../metadata_parser';
import { isTauri } from '../tauri.mjs'; import { isTauri } from '../tauri.mjs';
import './Repl.css'; import './Repl.css';
@ -164,3 +165,13 @@ export const setAudioDevice = async (id) => {
} }
initializeAudioOutput(); initializeAudioOutput();
}; };
export function setVersionDefaultsFrom(code) {
try {
const metadata = getMetadata(code);
setVersionDefaults(metadata.version);
} catch (err) {
console.error('Error parsing metadata..');
console.error(err);
}
}