This commit is contained in:
Felix Roos 2022-03-06 14:44:56 +01:00
parent 68b481af6e
commit 1d4129e84d
8 changed files with 94 additions and 66 deletions

View file

@ -526,8 +526,11 @@ class Pattern {
_legato(value) {
return this.withEventSpan((span) => new TimeSpan(span.begin, span.begin.add(span.end.sub(span.begin).mul(value))));
}
_velocity(velocity) {
return this._withContext((context) => ({...context, velocity: (context.velocity || 1) * velocity}));
}
}
Pattern.prototype.patternified = ["apply", "fast", "slow", "early", "late", "duration", "legato"];
Pattern.prototype.patternified = ["apply", "fast", "slow", "early", "late", "duration", "legato", "velocity"];
Pattern.prototype.factories = {pure, stack, slowcat, fastcat, cat, timeCat, sequence, polymeter, pm, polyrhythm, pr};
const silence = new Pattern((_) => []);
function pure(value) {