diff --git a/packages/core/controls.mjs b/packages/core/controls.mjs index 79dc33ab..2e8d40f7 100644 --- a/packages/core/controls.mjs +++ b/packages/core/controls.mjs @@ -553,7 +553,7 @@ export const { cutoff, ctf, lpf, lp } = registerControl(['cutoff', 'resonance', * @example * note("c2 e2 f2 g2") * .sound('sawtooth') - * .lpf(500) + * .lpf(300) * .lpa(.5) * .lpenv("<4 2 1 0 -1 -2 -4>/4") */ @@ -592,7 +592,7 @@ export const { bpenv, bpe } = registerControl('bpenv', 'bpe'); * @example * note("c2 e2 f2 g2") * .sound('sawtooth') - * .lpf(500) + * .lpf(300) * .lpa("<.5 .25 .1 .01>/4") * .lpenv(4) */ @@ -631,9 +631,8 @@ export const { bpattack, bpa } = registerControl('bpattack', 'bpa'); * @example * note("c2 e2 f2 g2") * .sound('sawtooth') - * .lpf(500) + * .lpf(300) * .lpd("<.5 .25 .1 0>/4") - * .lps(0.2) * .lpenv(4) */ export const { lpdecay, lpd } = registerControl('lpdecay', 'lpd'); @@ -673,7 +672,7 @@ export const { bpdecay, bpd } = registerControl('bpdecay', 'bpd'); * @example * note("c2 e2 f2 g2") * .sound('sawtooth') - * .lpf(500) + * .lpf(300) * .lpd(.5) * .lps("<0 .25 .5 1>/4") * .lpenv(4) @@ -716,7 +715,7 @@ export const { bpsustain, bps } = registerControl('bpsustain', 'bps'); * note("c2 e2 f2 g2") * .sound('sawtooth') * .clip(.5) - * .lpf(500) + * .lpf(300) * .lpenv(4) * .lpr("<.5 .25 .1 0>/4") * .release(.5) diff --git a/test/__snapshots__/examples.test.mjs.snap b/test/__snapshots__/examples.test.mjs.snap index efc5dda0..3ff7eae2 100644 --- a/test/__snapshots__/examples.test.mjs.snap +++ b/test/__snapshots__/examples.test.mjs.snap @@ -4060,64 +4060,64 @@ exports[`runs examples > example "loopEnd" 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 ]", - "[ 1/4 → 1/2 | note:e2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", - "[ 1/2 → 3/4 | note:f2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", - "[ 3/4 → 1/1 | note:g2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", - "[ 1/1 → 5/4 | note:c2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", - "[ 5/4 → 3/2 | note:e2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", - "[ 3/2 → 7/4 | note:f2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", - "[ 7/4 → 2/1 | note:g2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", - "[ 2/1 → 9/4 | note:c2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", - "[ 9/4 → 5/2 | note:e2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", - "[ 5/2 → 11/4 | note:f2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", - "[ 11/4 → 3/1 | note:g2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", - "[ 3/1 → 13/4 | note:c2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", - "[ 13/4 → 7/2 | note:e2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", - "[ 7/2 → 15/4 | note:f2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", - "[ 15/4 → 4/1 | note:g2 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:300 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:300 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:300 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:300 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:300 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:300 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:300 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:300 lpattack:0.5 lpenv:4 ]", ] `; 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 ]", - "[ 1/4 → 1/2 | note:e2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0.2 lpenv:4 ]", - "[ 1/2 → 3/4 | note:f2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0.2 lpenv:4 ]", - "[ 3/4 → 1/1 | note:g2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0.2 lpenv:4 ]", - "[ 1/1 → 5/4 | note:c2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0.2 lpenv:4 ]", - "[ 5/4 → 3/2 | note:e2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0.2 lpenv:4 ]", - "[ 3/2 → 7/4 | note:f2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0.2 lpenv:4 ]", - "[ 7/4 → 2/1 | note:g2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0.2 lpenv:4 ]", - "[ 2/1 → 9/4 | note:c2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0.2 lpenv:4 ]", - "[ 9/4 → 5/2 | note:e2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0.2 lpenv:4 ]", - "[ 5/2 → 11/4 | note:f2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0.2 lpenv:4 ]", - "[ 11/4 → 3/1 | note:g2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0.2 lpenv:4 ]", - "[ 3/1 → 13/4 | note:c2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0.2 lpenv:4 ]", - "[ 13/4 → 7/2 | note:e2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0.2 lpenv:4 ]", - "[ 7/2 → 15/4 | note:f2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0.2 lpenv:4 ]", - "[ 15/4 → 4/1 | note:g2 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:300 lpdecay:0.5 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:300 lpdecay:0.5 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:300 lpdecay:0.5 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:300 lpdecay:0.5 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:300 lpdecay:0.5 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:300 lpdecay:0.5 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:300 lpdecay:0.5 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:300 lpdecay:0.5 lpenv:4 ]", ] `; exports[`runs examples > example "lpenv" example index 0 1`] = ` [ - "[ 0/1 → 1/4 | note:c2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", - "[ 1/4 → 1/2 | note:e2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", - "[ 1/2 → 3/4 | note:f2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", - "[ 3/4 → 1/1 | note:g2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", - "[ 1/1 → 5/4 | note:c2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", - "[ 5/4 → 3/2 | note:e2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", - "[ 3/2 → 7/4 | note:f2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", - "[ 7/4 → 2/1 | note:g2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", - "[ 2/1 → 9/4 | note:c2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", - "[ 9/4 → 5/2 | note:e2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", - "[ 5/2 → 11/4 | note:f2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", - "[ 11/4 → 3/1 | note:g2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", - "[ 3/1 → 13/4 | note:c2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", - "[ 13/4 → 7/2 | note:e2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", - "[ 7/2 → 15/4 | note:f2 s:sawtooth cutoff:500 lpattack:0.5 lpenv:4 ]", - "[ 15/4 → 4/1 | note:g2 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:300 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:300 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:300 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:300 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:300 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:300 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:300 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: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`] = ` [ - "[ 0/1 → 1/4 | note:c2 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:500 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 ]", - "[ 3/4 → 1/1 | note:g2 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:500 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 ]", - "[ 3/2 → 7/4 | note:f2 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:500 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 ]", - "[ 9/4 → 5/2 | note:e2 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:500 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 ]", - "[ 3/1 → 13/4 | note:c2 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:500 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 ]", - "[ 15/4 → 4/1 | note:g2 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:300 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:300 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:300 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:300 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:300 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:300 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:300 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:300 lpenv:4 lprelease:0.5 release:0.5 ]", ] `; 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 ]", - "[ 1/4 → 1/2 | note:e2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0 lpenv:4 ]", - "[ 1/2 → 3/4 | note:f2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0 lpenv:4 ]", - "[ 3/4 → 1/1 | note:g2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0 lpenv:4 ]", - "[ 1/1 → 5/4 | note:c2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0 lpenv:4 ]", - "[ 5/4 → 3/2 | note:e2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0 lpenv:4 ]", - "[ 3/2 → 7/4 | note:f2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0 lpenv:4 ]", - "[ 7/4 → 2/1 | note:g2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0 lpenv:4 ]", - "[ 2/1 → 9/4 | note:c2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0 lpenv:4 ]", - "[ 9/4 → 5/2 | note:e2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0 lpenv:4 ]", - "[ 5/2 → 11/4 | note:f2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0 lpenv:4 ]", - "[ 11/4 → 3/1 | note:g2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0 lpenv:4 ]", - "[ 3/1 → 13/4 | note:c2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0 lpenv:4 ]", - "[ 13/4 → 7/2 | note:e2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0 lpenv:4 ]", - "[ 7/2 → 15/4 | note:f2 s:sawtooth cutoff:500 lpdecay:0.5 lpsustain:0 lpenv:4 ]", - "[ 15/4 → 4/1 | note:g2 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:300 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:300 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:300 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:300 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:300 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:300 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:300 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:300 lpdecay:0.5 lpsustain:0 lpenv:4 ]", ] `; diff --git a/website/src/docs/MiniRepl.jsx b/website/src/docs/MiniRepl.jsx index cadebcb3..03e3d6d3 100644 --- a/website/src/docs/MiniRepl.jsx +++ b/website/src/docs/MiniRepl.jsx @@ -6,15 +6,15 @@ import { transpiler } from '@strudel/transpiler'; import { getAudioContext, webaudioOutput, initAudioOnFirstClick } from '@strudel/webaudio'; import { StrudelMirror } from '@strudel/codemirror'; 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 useClient from '@src/useClient.mjs'; -let prebaked, modulesLoading, audioLoading; +let prebaked, modulesLoading, audioReady; if (typeof window !== 'undefined') { prebaked = prebake(); modulesLoading = loadModules(); - audioLoading = initAudioOnFirstClick(); + audioReady = initAudioOnFirstClick(); } export function MiniRepl({ @@ -69,10 +69,12 @@ export function MiniRepl({ } return pat; }, - prebake: async () => Promise.all([modulesLoading, prebaked, audioLoading]), + prebake: async () => Promise.all([modulesLoading, prebaked]), onUpdateState: (state) => { setReplState({ ...state }); }, + beforeEval: () => audioReady, // not doing this in prebake to make sure viz is drawn + afterEval: ({ code }) => setVersionDefaultsFrom(code), }); // init settings editor.setCode(code); diff --git a/website/src/examples.mjs b/website/src/examples.mjs index 61132dfa..83c77a9c 100644 --- a/website/src/examples.mjs +++ b/website/src/examples.mjs @@ -1,5 +1,6 @@ export const examples = [ `// "coastline" @by eddyflux +// @version 1.0 samples('github:eddyflux/crate') setcps(.75) let chords = chord("/4").dict('ireal') @@ -18,7 +19,7 @@ stack( n("<0!3 1*2>").set(chords).mode("root:g2") .voicing().s("gm_acoustic_bass"), 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)) .room(.75).shape(.3).delay(.25) .fm(sine.range(3,8).slow(8)) @@ -29,6 +30,7 @@ stack( ) .late("[0 .01]*4").late("[0 .01]*2").size(4)`, `// "broken cut 1" @by froos +// @version 1.0 samples('github:tidalcycles/dirt-samples') samples({ @@ -56,6 +58,7 @@ note("[c2 ~](3,8)*2,eb,g,bb,d").s("sawtooth") s("?").delay(".8:.1:.8").room(2).slow(8).cut(2), ).reset("".late(2))`, `// "acidic tooth" @by eddyflux +// @version 1.0 setcps(1) stack( note("[/8](<3 5>,8)") diff --git a/website/src/pages/learn/effects.mdx b/website/src/pages/learn/effects.mdx index 03ef6ef3..39f52e9f 100644 --- a/website/src/pages/learn/effects.mdx +++ b/website/src/pages/learn/effects.mdx @@ -94,7 +94,7 @@ Each filter can receive an additional filter envelope controlling the cutoff val client:idle tune={`note("[c eb g ](3,8,<0 1>)".sub(12)) .s("/64") - .lpf(sine.range(500,3000).slow(16)) + .lpf(sine.range(300,2000).slow(16)) .lpa(0.005) .lpd(perlin.range(.02,.2)) .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) .sometimes(add(note(12))) .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`: diff --git a/website/src/pages/recipes/recipes.mdx b/website/src/pages/recipes/recipes.mdx index 057743cb..dd195443 100644 --- a/website/src/pages/recipes/recipes.mdx +++ b/website/src/pages/recipes/recipes.mdx @@ -308,7 +308,7 @@ Running through different wavetables can also give interesting variations: ...adding a filter envelope + reverb: @@ -317,6 +317,6 @@ note("c2*8").s("wt_dbass").n(run(8))`} client:visible tune={`samples('github:bubobubobubobubo/dough-waveforms') note("c2*8").s("wt_dbass").n(run(8)) -.lpf(perlin.range(200,2000).slow(8)) -.lpenv(-3).lpa(.1).room(.5)`} +.lpf(perlin.range(100,1000).slow(8)) +.lpenv(-3).lpa(.1).room(.5).fast(2)`} /> diff --git a/website/src/pages/workshop/first-effects.mdx b/website/src/pages/workshop/first-effects.mdx index d82fd580..4a152224 100644 --- a/website/src/pages/workshop/first-effects.mdx +++ b/website/src/pages/workshop/first-effects.mdx @@ -262,7 +262,7 @@ By the way, inside Mini-Notation, `fast` is `*` and `slow` is `/`. ")`} /> -## automation with signals +## modulation 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? -We can change the automation speed with slow / fast: +We can change the modulation speed with slow / fast: -The whole automation will now take 8 cycles to repeat. +The whole modulation will now take 8 cycles to repeat. diff --git a/website/src/repl/Repl.jsx b/website/src/repl/Repl.jsx index 1ef8cbf2..e20551c4 100644 --- a/website/src/repl/Repl.jsx +++ b/website/src/repl/Repl.jsx @@ -16,7 +16,7 @@ import { initAudioOnFirstClick, } from '@strudel/webaudio'; 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 { clearHydra } from '@strudel/hydra'; import { useCallback, useEffect, useRef, useState } from 'react'; @@ -96,13 +96,7 @@ export function Repl({ embedded = false }) { window.location.hash = '#' + code2hash(code); setDocumentTitle(code); const viewingPatternData = getViewingPatternData(); - try { - const metadata = getMetadata(code); - setVersionDefaults(metadata.version); - } catch (err) { - console.error('Error parsing metadata..'); - console.error(err); - } + setVersionDefaultsFrom(code); const data = { ...viewingPatternData, code }; let id = data.id; const isExamplePattern = viewingPatternData.collection !== userPattern.collection; diff --git a/website/src/repl/util.mjs b/website/src/repl/util.mjs index 703d3447..26ac45d3 100644 --- a/website/src/repl/util.mjs +++ b/website/src/repl/util.mjs @@ -1,6 +1,7 @@ import { evalScope, hash2code, logger } from '@strudel/core'; 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 './Repl.css'; @@ -164,3 +165,13 @@ export const setAudioDevice = async (id) => { } initializeAudioOutput(); }; + +export function setVersionDefaultsFrom(code) { + try { + const metadata = getMetadata(code); + setVersionDefaults(metadata.version); + } catch (err) { + console.error('Error parsing metadata..'); + console.error(err); + } +}