Merge pull request #76 from tidalcycles/more-functions

add `striate()`
This commit is contained in:
Alex McLean
2022-04-21 14:21:29 +01:00
committed by GitHub
+8
View File
@@ -500,6 +500,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);
@@ -736,6 +743,7 @@ Pattern.prototype.patternified = [
'linger',
'ply',
'segment',
'striate',
'slow',
'velocity',
];