From ee5bc0f3a6ee76793b3b5ce33372764524a5bc3c Mon Sep 17 00:00:00 2001 From: alex Date: Sun, 15 May 2022 18:38:26 +0100 Subject: [PATCH] loopAt --- packages/core/pattern.mjs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/core/pattern.mjs b/packages/core/pattern.mjs index 6b7fb7a7..b34c1b58 100644 --- a/packages/core/pattern.mjs +++ b/packages/core/pattern.mjs @@ -977,6 +977,10 @@ export class Pattern { _velocity(velocity) { return this._withContext((context) => ({ ...context, velocity: (context.velocity || 1) * velocity })); } + + _loopAt(factor,cps=1) { + return this.speed((1/factor)*cps).unit("c").slow(factor) + } } // TODO - adopt value.mjs fully.. @@ -1400,6 +1404,10 @@ Pattern.prototype.chunkBack = function (...args) { args = args.map(reify); return patternify2(Pattern.prototype._chunkBack)(...args, this); }; +Pattern.prototype.loopAt = function (...args) { + args = args.map(reify); + return patternify2(Pattern.prototype._loopAt)(...args, this); +}; Pattern.prototype.zoom = function (...args) { args = args.map(reify); return patternify2(Pattern.prototype._zoom)(...args, this);