Document striate function

This commit is contained in:
Alexandre G.-Raymond 2023-10-28 11:47:37 +02:00
parent 248757ac3f
commit 1e1d5ef442
No known key found for this signature in database
GPG key ID: 97BA9F51695B5C7B
3 changed files with 29 additions and 0 deletions

View file

@ -2217,6 +2217,14 @@ export const chop = register('chop', function (n, pat) {
return pat.squeezeBind(func);
});
/**
* Cuts each sample into the given number of parts, triggering progressive portions of each sample at each loop.
* @name striate
* @memberof Pattern
* @returns Pattern
* @example
* s("numbers:0 numbers:1 numbers:2").striate(6).slow(6)
*/
export const striate = register('striate', function (n, pat) {
const slices = Array.from({ length: n }, (x, i) => i);
const slice_objects = slices.map((i) => ({ begin: i / n, end: (i + 1) / n }));