diff --git a/packages/codemirror/slider.mjs b/packages/codemirror/slider.mjs index 519e5610..1ae3deaf 100644 --- a/packages/codemirror/slider.mjs +++ b/packages/codemirror/slider.mjs @@ -111,6 +111,15 @@ export const sliderPlugin = ViewPlugin.fromClass( }, ); +/** + * Displays a slider widget to allow the user manipulate a value + * + * @name slider + * @param {number} value Initial value + * @param {number} min Minimum value - optional, defaults to 0 + * @param {number} max Maximum value - optional, defaults to 1 + * @param {number} step Step size - optional + */ export let slider = (value) => { console.warn('slider will only work when the transpiler is used... passing value as is'); return pure(value); diff --git a/packages/core/euclid.mjs b/packages/core/euclid.mjs index 29539cf9..e6240920 100644 --- a/packages/core/euclid.mjs +++ b/packages/core/euclid.mjs @@ -145,6 +145,8 @@ export const { euclidrot, euclidRot } = register(['euclidrot', 'euclidRot'], fun * so there will be no gaps. * @name euclidLegato * @memberof Pattern + * @param {number} pulses the number of onsets / beats + * @param {number} steps the number of steps to fill * @example * n("g2").decay(.1).sustain(.3).euclidLegato(3,8) */ @@ -166,6 +168,18 @@ export const euclidLegato = register(['euclidLegato'], function (pulses, steps, return _euclidLegato(pulses, steps, 0, pat); }); +/** + * Similar to `euclid`, but each pulse is held until the next pulse, + * so there will be no gaps, and has an additional parameter for 'rotating' + * the resulting sequence + * @name euclidLegatoRot + * @memberof Pattern + * @param {number} pulses the number of onsets / beats + * @param {number} steps the number of steps to fill + * @param {number} rotation offset in steps + * @example + * note("c3").euclidLegatoRot(3,5,2) + */ export const euclidLegatoRot = register(['euclidLegatoRot'], function (pulses, steps, rotation, pat) { return _euclidLegato(pulses, steps, rotation, pat); }); diff --git a/packages/core/pianoroll.mjs b/packages/core/pianoroll.mjs index c10460a4..254dd94a 100644 --- a/packages/core/pianoroll.mjs +++ b/packages/core/pianoroll.mjs @@ -262,6 +262,12 @@ Pattern.prototype.punchcard = function (options) { ); }; +/** + * Displays a vertical pianoroll with event labels. + * Supports all the same options as pianoroll. + * + * @name wordfall + */ Pattern.prototype.wordfall = function (options) { return this.punchcard({ vertical: 1, labels: 1, stroke: 0, fillActive: 1, active: 'white', ...options }); }; diff --git a/test/__snapshots__/examples.test.mjs.snap b/test/__snapshots__/examples.test.mjs.snap index a12fcb65..34f7a850 100644 --- a/test/__snapshots__/examples.test.mjs.snap +++ b/test/__snapshots__/examples.test.mjs.snap @@ -1798,6 +1798,23 @@ exports[`runs examples > example "euclidLegato" example index 0 1`] = ` ] `; +exports[`runs examples > example "euclidLegatoRot" example index 0 1`] = ` +[ + "[ 0/1 → 1/4 | note:c3 ]", + "[ 1/4 → 3/4 | note:c3 ]", + "[ 3/4 → 1/1 | note:c3 ]", + "[ 1/1 → 5/4 | note:c3 ]", + "[ 5/4 → 7/4 | note:c3 ]", + "[ 7/4 → 2/1 | note:c3 ]", + "[ 2/1 → 9/4 | note:c3 ]", + "[ 9/4 → 11/4 | note:c3 ]", + "[ 11/4 → 3/1 | note:c3 ]", + "[ 3/1 → 13/4 | note:c3 ]", + "[ 13/4 → 15/4 | note:c3 ]", + "[ 15/4 → 4/1 | note:c3 ]", +] +`; + exports[`runs examples > example "euclidRot" example index 0 1`] = ` [ "[ 3/16 → 1/4 | note:c3 ]",