add Pattern.len
This commit is contained in:
parent
e78b3a88d7
commit
52da8552ef
1 changed files with 6 additions and 1 deletions
|
|
@ -744,6 +744,11 @@ class Pattern {
|
|||
hush() {
|
||||
return silence;
|
||||
}
|
||||
|
||||
_len(value) {
|
||||
// return this.withEventSpan((span) => new TimeSpan(span.begin, span.begin.add(span.end.sub(span.begin).mul(value))));
|
||||
return this.withEventSpan((span) => new TimeSpan(span.begin, span.begin.add(value)));
|
||||
}
|
||||
/*
|
||||
_resolveTies() {
|
||||
return this._withEvents((events)=>{
|
||||
|
|
@ -763,7 +768,7 @@ class Pattern {
|
|||
}
|
||||
|
||||
// methods of Pattern that get callable factories
|
||||
Pattern.prototype.patternified = ['apply', 'fast', 'slow', 'early', 'late'];
|
||||
Pattern.prototype.patternified = ['apply', 'fast', 'slow', 'early', 'late', 'len'];
|
||||
// methods that create patterns, which are added to patternified Pattern methods
|
||||
Pattern.prototype.factories = { pure, stack, slowcat, fastcat, cat, timeCat, sequence, polymeter, pm, polyrhythm, pr};
|
||||
// the magic happens in Pattern constructor. Keeping this in prototype enables adding methods from the outside (e.g. see tonal.ts)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue