Combine examples for stack, match wording for cat, stack and seq
This commit is contained in:
parent
717e4a2c1d
commit
2c16a37a68
2 changed files with 54 additions and 32 deletions
|
|
@ -809,15 +809,6 @@ export class Pattern {
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// Multi-pattern functions
|
// Multi-pattern functions
|
||||||
|
|
||||||
/**
|
|
||||||
* Stacks the given pattern(s) to the current pattern.
|
|
||||||
* @name stack
|
|
||||||
* @memberof Pattern
|
|
||||||
* @example
|
|
||||||
* s("hh*4").stack(
|
|
||||||
* note("c4(5,8)")
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
stack(...pats) {
|
stack(...pats) {
|
||||||
return stack(this, ...pats);
|
return stack(this, ...pats);
|
||||||
}
|
}
|
||||||
|
|
@ -1254,11 +1245,18 @@ export function reify(thing) {
|
||||||
|
|
||||||
/** The given items are played at the same time at the same length.
|
/** The given items are played at the same time at the same length.
|
||||||
*
|
*
|
||||||
|
* @name stack
|
||||||
* @return {Pattern}
|
* @return {Pattern}
|
||||||
* @synonyms polyrhythm, pr
|
* @synonyms polyrhythm, pr
|
||||||
* @example
|
* @example
|
||||||
* stack("g3", "b3", ["e4", "d4"]).note()
|
* stack("g3", "b3", ["e4", "d4"]).note()
|
||||||
* // "g3,b3,[e4,d4]".note()
|
* // "g3,b3,[e4,d4]".note()
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* // As a chained function:
|
||||||
|
* s("hh*4").stack(
|
||||||
|
* note("c4(5,8)")
|
||||||
|
* )
|
||||||
*/
|
*/
|
||||||
export function stack(...pats) {
|
export function stack(...pats) {
|
||||||
// Array test here is to avoid infinite recursions..
|
// Array test here is to avoid infinite recursions..
|
||||||
|
|
@ -1380,14 +1378,16 @@ export function slowcatPrime(...pats) {
|
||||||
|
|
||||||
/** The given items are con**cat**enated, where each one takes one cycle.
|
/** The given items are con**cat**enated, where each one takes one cycle.
|
||||||
*
|
*
|
||||||
|
* @name cat
|
||||||
* @param {...any} items - The items to concatenate
|
* @param {...any} items - The items to concatenate
|
||||||
* @synonyms slowcat
|
* @synonyms slowcat
|
||||||
* @return {Pattern}
|
* @return {Pattern}
|
||||||
* @example
|
* @example
|
||||||
* cat("e5", "b4", ["d5", "c5"]).note()
|
* cat("e5", "b4", ["d5", "c5"]).note()
|
||||||
* // "<e5 b4 [d5 c5]>".note()
|
* // "<e5 b4 [d5 c5]>".note()
|
||||||
|
*
|
||||||
* @example
|
* @example
|
||||||
* // You can also use cat as a chained function like this:
|
* // As a chained function:
|
||||||
* s("hh*4").cat(
|
* s("hh*4").cat(
|
||||||
* note("c4(5,8)")
|
* note("c4(5,8)")
|
||||||
* )
|
* )
|
||||||
|
|
@ -1468,7 +1468,8 @@ export function sequence(...pats) {
|
||||||
* seq("e5", "b4", ["d5", "c5"]).note()
|
* seq("e5", "b4", ["d5", "c5"]).note()
|
||||||
* // "e5 b4 [d5 c5]".note()
|
* // "e5 b4 [d5 c5]".note()
|
||||||
*
|
*
|
||||||
* // Or as a chained function:
|
* @example
|
||||||
|
* // As a chained function:
|
||||||
* s("hh*4").seq(
|
* s("hh*4").seq(
|
||||||
* note("c4(5,8)")
|
* note("c4(5,8)")
|
||||||
* )
|
* )
|
||||||
|
|
|
||||||
|
|
@ -6976,6 +6976,27 @@ exports[`runs examples > example "segment" example index 0 1`] = `
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`runs examples > example "seq" example index 0 1`] = `
|
exports[`runs examples > example "seq" example index 0 1`] = `
|
||||||
|
[
|
||||||
|
"[ 0/1 → 1/3 | note:e5 ]",
|
||||||
|
"[ 1/3 → 2/3 | note:b4 ]",
|
||||||
|
"[ 2/3 → 5/6 | note:d5 ]",
|
||||||
|
"[ 5/6 → 1/1 | note:c5 ]",
|
||||||
|
"[ 1/1 → 4/3 | note:e5 ]",
|
||||||
|
"[ 4/3 → 5/3 | note:b4 ]",
|
||||||
|
"[ 5/3 → 11/6 | note:d5 ]",
|
||||||
|
"[ 11/6 → 2/1 | note:c5 ]",
|
||||||
|
"[ 2/1 → 7/3 | note:e5 ]",
|
||||||
|
"[ 7/3 → 8/3 | note:b4 ]",
|
||||||
|
"[ 8/3 → 17/6 | note:d5 ]",
|
||||||
|
"[ 17/6 → 3/1 | note:c5 ]",
|
||||||
|
"[ 3/1 → 10/3 | note:e5 ]",
|
||||||
|
"[ 10/3 → 11/3 | note:b4 ]",
|
||||||
|
"[ 11/3 → 23/6 | note:d5 ]",
|
||||||
|
"[ 23/6 → 4/1 | note:c5 ]",
|
||||||
|
]
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`runs examples > example "seq" example index 1 1`] = `
|
||||||
[
|
[
|
||||||
"[ 0/1 → 1/8 | s:hh ]",
|
"[ 0/1 → 1/8 | s:hh ]",
|
||||||
"[ 1/8 → 1/4 | s:hh ]",
|
"[ 1/8 → 1/4 | s:hh ]",
|
||||||
|
|
@ -7709,6 +7730,27 @@ exports[`runs examples > example "squiz" example index 0 1`] = `
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`runs examples > example "stack" example index 0 1`] = `
|
exports[`runs examples > example "stack" example index 0 1`] = `
|
||||||
|
[
|
||||||
|
"[ 0/1 → 1/2 | note:e4 ]",
|
||||||
|
"[ 0/1 → 1/1 | note:g3 ]",
|
||||||
|
"[ 0/1 → 1/1 | note:b3 ]",
|
||||||
|
"[ 1/2 → 1/1 | note:d4 ]",
|
||||||
|
"[ 1/1 → 3/2 | note:e4 ]",
|
||||||
|
"[ 1/1 → 2/1 | note:g3 ]",
|
||||||
|
"[ 1/1 → 2/1 | note:b3 ]",
|
||||||
|
"[ 3/2 → 2/1 | note:d4 ]",
|
||||||
|
"[ 2/1 → 5/2 | note:e4 ]",
|
||||||
|
"[ 2/1 → 3/1 | note:g3 ]",
|
||||||
|
"[ 2/1 → 3/1 | note:b3 ]",
|
||||||
|
"[ 5/2 → 3/1 | note:d4 ]",
|
||||||
|
"[ 3/1 → 7/2 | note:e4 ]",
|
||||||
|
"[ 3/1 → 4/1 | note:g3 ]",
|
||||||
|
"[ 3/1 → 4/1 | note:b3 ]",
|
||||||
|
"[ 7/2 → 4/1 | note:d4 ]",
|
||||||
|
]
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`runs examples > example "stack" example index 1 1`] = `
|
||||||
[
|
[
|
||||||
"[ 0/1 → 1/8 | note:c4 ]",
|
"[ 0/1 → 1/8 | note:c4 ]",
|
||||||
"[ 0/1 → 1/4 | s:hh ]",
|
"[ 0/1 → 1/4 | s:hh ]",
|
||||||
|
|
@ -7749,27 +7791,6 @@ exports[`runs examples > example "stack" example index 0 1`] = `
|
||||||
]
|
]
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`runs examples > example "stack" example index 0 2`] = `
|
|
||||||
[
|
|
||||||
"[ 0/1 → 1/2 | note:e4 ]",
|
|
||||||
"[ 0/1 → 1/1 | note:g3 ]",
|
|
||||||
"[ 0/1 → 1/1 | note:b3 ]",
|
|
||||||
"[ 1/2 → 1/1 | note:d4 ]",
|
|
||||||
"[ 1/1 → 3/2 | note:e4 ]",
|
|
||||||
"[ 1/1 → 2/1 | note:g3 ]",
|
|
||||||
"[ 1/1 → 2/1 | note:b3 ]",
|
|
||||||
"[ 3/2 → 2/1 | note:d4 ]",
|
|
||||||
"[ 2/1 → 5/2 | note:e4 ]",
|
|
||||||
"[ 2/1 → 3/1 | note:g3 ]",
|
|
||||||
"[ 2/1 → 3/1 | note:b3 ]",
|
|
||||||
"[ 5/2 → 3/1 | note:d4 ]",
|
|
||||||
"[ 3/1 → 7/2 | note:e4 ]",
|
|
||||||
"[ 3/1 → 4/1 | note:g3 ]",
|
|
||||||
"[ 3/1 → 4/1 | note:b3 ]",
|
|
||||||
"[ 7/2 → 4/1 | note:d4 ]",
|
|
||||||
]
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports[`runs examples > example "steps" example index 0 1`] = `
|
exports[`runs examples > example "steps" example index 0 1`] = `
|
||||||
[
|
[
|
||||||
"[ 0/1 → 1/4 | s:bd ]",
|
"[ 0/1 → 1/4 | s:bd ]",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue