diff --git a/packages/core/signal.mjs b/packages/core/signal.mjs index 8bf3c911..d1408809 100644 --- a/packages/core/signal.mjs +++ b/packages/core/signal.mjs @@ -173,7 +173,7 @@ export const __chooseWith = (pat, xs) => { * @param {*} xs * @returns {Pattern} * @example - * note("c g g d f").s(chooseWith(slider(0, 0, 1), ["sawtooth", "triangle", "bd hh sd hh"])) + * note("c2 g2!2 d2 f1").s(chooseWith(sine.fast(2), ["sawtooth", "triangle", "bd:6"])) */ export const chooseWith = (pat, xs) => { return __chooseWith(pat, xs).outerJoin(); diff --git a/test/__snapshots__/examples.test.mjs.snap b/test/__snapshots__/examples.test.mjs.snap index f351a5a0..ed0249f3 100644 --- a/test/__snapshots__/examples.test.mjs.snap +++ b/test/__snapshots__/examples.test.mjs.snap @@ -1071,6 +1071,31 @@ exports[`runs examples > example "chooseCycles" example index 1 1`] = ` ] `; +exports[`runs examples > example "chooseWith" example index 0 1`] = ` +[ + "[ 0/1 → 1/5 | note:c2 s:bd n:6 ]", + "[ 1/5 → 2/5 | note:g2 s:sawtooth ]", + "[ 2/5 → 3/5 | note:g2 s:triangle ]", + "[ 3/5 → 4/5 | note:d2 s:bd n:6 ]", + "[ 4/5 → 1/1 | note:f1 s:sawtooth ]", + "[ 1/1 → 6/5 | note:c2 s:bd n:6 ]", + "[ 6/5 → 7/5 | note:g2 s:sawtooth ]", + "[ 7/5 → 8/5 | note:g2 s:triangle ]", + "[ 8/5 → 9/5 | note:d2 s:bd n:6 ]", + "[ 9/5 → 2/1 | note:f1 s:sawtooth ]", + "[ 2/1 → 11/5 | note:c2 s:bd n:6 ]", + "[ 11/5 → 12/5 | note:g2 s:sawtooth ]", + "[ 12/5 → 13/5 | note:g2 s:triangle ]", + "[ 13/5 → 14/5 | note:d2 s:bd n:6 ]", + "[ 14/5 → 3/1 | note:f1 s:sawtooth ]", + "[ 3/1 → 16/5 | note:c2 s:bd n:6 ]", + "[ 16/5 → 17/5 | note:g2 s:sawtooth ]", + "[ 17/5 → 18/5 | note:g2 s:triangle ]", + "[ 18/5 → 19/5 | note:d2 s:bd n:6 ]", + "[ 19/5 → 4/1 | note:f1 s:sawtooth ]", +] +`; + exports[`runs examples > example "chop" example index 0 1`] = ` [ "[ 0/1 → 1/1 | s:rhodes begin:0.75 end:1 speed:0.25 unit:c ]",