add .range

This commit is contained in:
Felix Roos 2022-04-05 23:37:27 +02:00
parent 0e7b345010
commit fb1976a6bc

View File

@ -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