From 988e81670dfa06c1ddf3568b9b555f35f9751fff Mon Sep 17 00:00:00 2001 From: alex Date: Sun, 6 Feb 2022 23:27:37 +0000 Subject: [PATCH] patternify slow, early and late --- strudel.mjs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/strudel.mjs b/strudel.mjs index 03c862ef..8770728f 100644 --- a/strudel.mjs +++ b/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)