From fb1976a6bccb5685b69dac2db9f1beac6f45c3fd Mon Sep 17 00:00:00 2001 From: Felix Roos Date: Tue, 5 Apr 2022 23:37:27 +0200 Subject: [PATCH] add .range --- packages/core/strudel.mjs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/core/strudel.mjs b/packages/core/strudel.mjs index 01c2b86c..4e58ef21 100644 --- a/packages/core/strudel.mjs +++ b/packages/core/strudel.mjs @@ -780,7 +780,7 @@ class Pattern { // known as iter' in tidalcycles iterBack(times) { - return this.iter(times, true) + return this.iter(times, true); } _chunk(n, func, back = false) { @@ -823,6 +823,10 @@ class Pattern { _velocity(velocity) { return this._withContext((context) => ({ ...context, velocity: (context.velocity || 1) * velocity })); } + + range(min, max) { + return this.mul(max - min).add(min) + } } // methods of Pattern that get callable factories