mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-11 21:58:37 +00:00
patternify slow, early and late
This commit is contained in:
parent
de7b67f085
commit
988e81670d
16
strudel.mjs
16
strudel.mjs
@ -444,20 +444,30 @@ class Pattern {
|
||||
_slow(factor) {
|
||||
return this._fast(1/factor)
|
||||
}
|
||||
// slow = _patternify(_slow)
|
||||
|
||||
slow(factor) {
|
||||
return this._patternify(Pattern.prototype._slow)(factor)
|
||||
}
|
||||
|
||||
_early(offset) {
|
||||
// Equivalent of Tidal's <~ operator
|
||||
offset = Fraction(offset)
|
||||
return this.withQueryTime(t => t.add(offset)).withEventTime(t => t.sub(offset))
|
||||
}
|
||||
// early = _patternify(_early)
|
||||
|
||||
early(factor) {
|
||||
return this._patternify(Pattern.prototype._early)(factor)
|
||||
}
|
||||
|
||||
_late(offset) {
|
||||
// Equivalent of Tidal's ~> operator
|
||||
return this._early(0-offset)
|
||||
}
|
||||
// late = _patternify(_late)
|
||||
|
||||
|
||||
late(factor) {
|
||||
return this._patternify(Pattern.prototype._late)(factor)
|
||||
}
|
||||
|
||||
when(binary_pat, func) {
|
||||
//binary_pat = sequence(binary_pat)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user