Merge pull request #114 from tidalcycles/more-functions

loopAt
This commit is contained in:
Alex McLean 2022-05-15 21:28:24 +01:00 committed by GitHub
commit ee45337d89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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