diff --git a/packages/core/pattern.mjs b/packages/core/pattern.mjs index f08520cb..c1b39820 100644 --- a/packages/core/pattern.mjs +++ b/packages/core/pattern.mjs @@ -1396,7 +1396,11 @@ export function slowcatPrime(...pats) { * @example * cat("e5", "b4", ["d5", "c5"]).note() * // "".note() - * + * @example + * // You can also use cat as a chained function like this: + * s("hh*4").cat( + * note("c4(5,8)") + * ) */ export function cat(...pats) { return slowcat(...pats); diff --git a/test/__snapshots__/examples.test.mjs.snap b/test/__snapshots__/examples.test.mjs.snap index 55c6b2cb..f4e6f56e 100644 --- a/test/__snapshots__/examples.test.mjs.snap +++ b/test/__snapshots__/examples.test.mjs.snap @@ -1388,6 +1388,29 @@ exports[`runs examples > example "cat" example index 0 1`] = ` ] `; +exports[`runs examples > example "cat" example index 1 1`] = ` +[ + "[ 0/1 → 1/4 | s:hh ]", + "[ 1/4 → 1/2 | s:hh ]", + "[ 1/2 → 3/4 | s:hh ]", + "[ 3/4 → 1/1 | s:hh ]", + "[ 1/1 → 9/8 | note:c4 ]", + "[ 5/4 → 11/8 | note:c4 ]", + "[ 11/8 → 3/2 | note:c4 ]", + "[ 13/8 → 7/4 | note:c4 ]", + "[ 7/4 → 15/8 | note:c4 ]", + "[ 2/1 → 9/4 | s:hh ]", + "[ 9/4 → 5/2 | s:hh ]", + "[ 5/2 → 11/4 | s:hh ]", + "[ 11/4 → 3/1 | s:hh ]", + "[ 3/1 → 25/8 | note:c4 ]", + "[ 13/4 → 27/8 | note:c4 ]", + "[ 27/8 → 7/2 | note:c4 ]", + "[ 29/8 → 15/4 | note:c4 ]", + "[ 15/4 → 31/8 | note:c4 ]", +] +`; + exports[`runs examples > example "ceil" example index 0 1`] = ` [ "[ 0/1 → 1/4 | note:42 ]",