mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-12 06:08:37 +00:00
add Pattern.len
This commit is contained in:
parent
e78b3a88d7
commit
52da8552ef
@ -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…
x
Reference in New Issue
Block a user