From 1d56d7975774a97c040f05166e4e07c4072ef272 Mon Sep 17 00:00:00 2001 From: alex Date: Sun, 17 Apr 2022 23:18:01 +0100 Subject: [PATCH] add `striate()` --- packages/core/pattern.mjs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/core/pattern.mjs b/packages/core/pattern.mjs index 71f9755a..8f1f7d61 100644 --- a/packages/core/pattern.mjs +++ b/packages/core/pattern.mjs @@ -496,6 +496,13 @@ export class Pattern { return this._squeezeBind(func); } + _striate(n) { + const slices = Array.from({ length: n }, (x, i) => i); + const slice_objects = slices.map((i) => ({ begin: i / n, end: (i + 1) / n })); + const slicePat = slowcat(...slice_objects); + return this.union(slicePat)._fast(n); + } + // cpm = cycles per minute _cpm(cpm) { return this._fast(cpm / 60); @@ -732,6 +739,7 @@ Pattern.prototype.patternified = [ 'linger', 'ply', 'segment', + 'striate', 'slow', 'velocity', ];