diff --git a/packages/core/pattern.mjs b/packages/core/pattern.mjs index 8968b508f..1b4ac6b26 100644 --- a/packages/core/pattern.mjs +++ b/packages/core/pattern.mjs @@ -886,6 +886,10 @@ export class Pattern { return stackRight(this, ...pats); } + stackCenter(...pats) { + return stackCenter(this, ...pats); + } + stackCentre(...pats) { return stackCentre(this, ...pats); } @@ -1666,7 +1670,7 @@ function _stackWith(func, pats) { } /** - * The input patterns are aligned to the left, with silence padded to the shorter pattern(s) in the final steps if there's a stepcount disparity. See also `stackRight` and `stackCentre/stackCenter` + * The input patterns are aligned to the left, with silence padded to the shorter pattern(s) in the final steps if there's a stepcount disparity. See also `stackRight` and `stackCenter/stackCentre` * * @name stackLeft * @tags temporal, stepwise, combiners @@ -1685,7 +1689,7 @@ export function stackLeft(...pats) { } /** - * The input patterns are aligned to the right, with silence padded to the shorter pattern(s) in the initial steps if there's a stepcount disparity. See also `stackLeft` and `stackCentre/stackCenter` + * The input patterns are aligned to the right, with silence padded to the shorter pattern(s) in the initial steps if there's a stepcount disparity. See also `stackLeft` and `stackCenter/stackCentre` * * @name stackRight * @tags temporal, stepwise, combiners @@ -1705,17 +1709,17 @@ export function stackRight(...pats) { /** * The input patterns are aligned to the right, with silence padded to the shorter pattern(s) in the initial steps if there's a stepcount disparity. See also `stackLeft` and `stackRight` - * @name stackCentre + * @name stackCenter * @tags temporal, stepwise, combiners - * @synonyms stackCenter + * @synonyms stackCentre * @return {Pattern} * @example - * stackCentre("0 1 2 3", "3 4", "[4 5 6] 7 8 9 10").scale("c:minor").note() + * stackCenter("0 1 2 3", "3 4", "[4 5 6] 7 8 9 10").scale("c:minor").note() * @example * // chainable - * "0 1 2 3".stackCentre("3 4", "[4 5 6] 7 8 9 10").scale("c:minor").note() + * "0 1 2 3".stackCenter("3 4", "[4 5 6] 7 8 9 10").scale("c:minor").note() */ -export function stackCentre(...pats) { +export function stackCenter(...pats) { return _stackWith( (steps, pats) => pats.map((pat) => { @@ -1729,8 +1733,8 @@ export function stackCentre(...pats) { ); } -export function stackCenter(pats) { - return stackCentre(pats); +export function stackCentre(...pats) { + return stackCenter(...pats); } /** diff --git a/packages/core/signal.mjs b/packages/core/signal.mjs index 83a35d677..0316c86fe 100644 --- a/packages/core/signal.mjs +++ b/packages/core/signal.mjs @@ -6,6 +6,7 @@ This program is free software: you can redistribute it and/or modify it under th import { Hap } from './hap.mjs'; import { Pattern, fastcat, pure, register, reify, silence, stack, sequenceP, isPattern } from './pattern.mjs'; +import { _mod } from './util.mjs'; import Fraction from './fraction.mjs'; import { id, keyAlias, getCurrentKeyboardState } from './util.mjs'; diff --git a/test/__snapshots__/examples.test.mjs.snap b/test/__snapshots__/examples.test.mjs.snap index 1d8d69922..d1e8599f3 100644 --- a/test/__snapshots__/examples.test.mjs.snap +++ b/test/__snapshots__/examples.test.mjs.snap @@ -7908,15 +7908,6 @@ exports[`runs examples > example "midi" example index 0 1`] = ` ] `; -exports[`runs examples > example "midi" example index 1 1`] = ` -[ - "[ 0/1 → 1/1 | note:c4 midichan:1 ]", - "[ 1/1 → 2/1 | note:c4 midichan:1 ]", - "[ 2/1 → 3/1 | note:c4 midichan:1 ]", - "[ 3/1 → 4/1 | note:c4 midichan:1 ]", -] -`; - exports[`runs examples > example "midibend" example index 0 1`] = ` [ "[ 0/1 → 1/1 | note:c4 midibend:0 ]", @@ -13144,7 +13135,7 @@ exports[`runs examples > example "stack" example index 1 1`] = ` ] `; -exports[`runs examples > example "stackCentre" example index 0 1`] = ` +exports[`runs examples > example "stackCenter" example index 0 1`] = ` [ "[ 0/1 → 1/15 | note:G3 ]", "[ 1/15 → 2/15 | note:Ab3 ]", @@ -13201,7 +13192,7 @@ exports[`runs examples > example "stackCentre" example index 0 1`] = ` ] `; -exports[`runs examples > example "stackCentre" example index 1 1`] = ` +exports[`runs examples > example "stackCenter" example index 1 1`] = ` [ "[ 0/1 → 1/15 | note:G3 ]", "[ 1/15 → 2/15 | note:Ab3 ]",