Update replicate and extend examples to show difference

This commit is contained in:
tyow
2026-02-28 14:43:04 -05:00
parent 37d052a655
commit 36a456eeb4
2 changed files with 8 additions and 11 deletions
+3 -6
View File
@@ -3396,7 +3396,7 @@ export const drop = stepRegister('drop', function (i, pat) {
* @tags stepwise
* @example
* stepcat(
* sound("bd bd - cp").extend(2),
* sound("bd bd - <cp hh>").extend(2),
* sound("bd - sd -")
* ).pace(8)
*/
@@ -3407,15 +3407,12 @@ export const extend = stepRegister('extend', function (factor, pat) {
/**
* *Experimental*
*
* `replicate` is similar to `fast` in that it increases its density, but it also increases the step count
* accordingly. So `stepcat("a b".replicate(2), "c d")` would be the same as `"a b a b c d"`, whereas
* `stepcat("a b".fast(2), "c d")` would be the same as `"[a b] [a b] c d"`.
* `replicate` is similar to `extend`, except that `replicate` will "replicate" the thing being extended. This will only differ from `extend` when the input pattern differs from cycle to cycle.
*
* TODO: find out how this function differs from extend
* @tags stepwise
* @example
* stepcat(
* sound("bd bd - cp").replicate(2),
* sound("bd bd - <cp hh>").replicate(2),
* sound("bd - sd -")
* ).pace(8)
*/
+5 -5
View File
@@ -4371,7 +4371,7 @@ exports[`runs examples > example "extend" example index 0 1`] = `
"[ 3/8 → 1/2 | s:cp ]",
"[ 1/2 → 5/8 | s:bd ]",
"[ 5/8 → 3/4 | s:bd ]",
"[ 7/8 → 1/1 | s:cp ]",
"[ 7/8 → 1/1 | s:hh ]",
"[ 1/1 → 9/8 | s:bd ]",
"[ 5/4 → 11/8 | s:sd ]",
"[ 3/2 → 13/8 | s:bd ]",
@@ -4379,7 +4379,7 @@ exports[`runs examples > example "extend" example index 0 1`] = `
"[ 15/8 → 2/1 | s:cp ]",
"[ 2/1 → 17/8 | s:bd ]",
"[ 17/8 → 9/4 | s:bd ]",
"[ 19/8 → 5/2 | s:cp ]",
"[ 19/8 → 5/2 | s:hh ]",
"[ 5/2 → 21/8 | s:bd ]",
"[ 11/4 → 23/8 | s:sd ]",
"[ 3/1 → 25/8 | s:bd ]",
@@ -4387,7 +4387,7 @@ exports[`runs examples > example "extend" example index 0 1`] = `
"[ 27/8 → 7/2 | s:cp ]",
"[ 7/2 → 29/8 | s:bd ]",
"[ 29/8 → 15/4 | s:bd ]",
"[ 31/8 → 4/1 | s:cp ]",
"[ 31/8 → 4/1 | s:hh ]",
]
`;
@@ -10148,10 +10148,10 @@ exports[`runs examples > example "replicate" example index 0 1`] = `
"[ 5/4 → 11/8 | s:sd ]",
"[ 3/2 → 13/8 | s:bd ]",
"[ 13/8 → 7/4 | s:bd ]",
"[ 15/8 → 2/1 | s:cp ]",
"[ 15/8 → 2/1 | s:hh ]",
"[ 2/1 → 17/8 | s:bd ]",
"[ 17/8 → 9/4 | s:bd ]",
"[ 19/8 → 5/2 | s:cp ]",
"[ 19/8 → 5/2 | s:hh ]",
"[ 5/2 → 21/8 | s:bd ]",
"[ 11/4 → 23/8 | s:sd ]",
"[ 3/1 → 25/8 | s:bd ]",