mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-17 00:28:27 +00:00
Merge pull request #801 from ilesinge/add_doc
Add doc for euclidLegatoRot, wordfall and slider
This commit is contained in:
commit
b73ea7f086
@ -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) => {
|
export let slider = (value) => {
|
||||||
console.warn('slider will only work when the transpiler is used... passing value as is');
|
console.warn('slider will only work when the transpiler is used... passing value as is');
|
||||||
return pure(value);
|
return pure(value);
|
||||||
|
|||||||
@ -145,6 +145,8 @@ export const { euclidrot, euclidRot } = register(['euclidrot', 'euclidRot'], fun
|
|||||||
* so there will be no gaps.
|
* so there will be no gaps.
|
||||||
* @name euclidLegato
|
* @name euclidLegato
|
||||||
* @memberof Pattern
|
* @memberof Pattern
|
||||||
|
* @param {number} pulses the number of onsets / beats
|
||||||
|
* @param {number} steps the number of steps to fill
|
||||||
* @example
|
* @example
|
||||||
* n("g2").decay(.1).sustain(.3).euclidLegato(3,8)
|
* 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);
|
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) {
|
export const euclidLegatoRot = register(['euclidLegatoRot'], function (pulses, steps, rotation, pat) {
|
||||||
return _euclidLegato(pulses, steps, rotation, pat);
|
return _euclidLegato(pulses, steps, rotation, pat);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -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) {
|
Pattern.prototype.wordfall = function (options) {
|
||||||
return this.punchcard({ vertical: 1, labels: 1, stroke: 0, fillActive: 1, active: 'white', ...options });
|
return this.punchcard({ vertical: 1, labels: 1, stroke: 0, fillActive: 1, active: 'white', ...options });
|
||||||
};
|
};
|
||||||
|
|||||||
@ -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`] = `
|
exports[`runs examples > example "euclidRot" example index 0 1`] = `
|
||||||
[
|
[
|
||||||
"[ 3/16 → 1/4 | note:c3 ]",
|
"[ 3/16 → 1/4 | note:c3 ]",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user