diff --git a/strudel.mjs b/strudel.mjs index cd1656a0..ae9bf4b7 100644 --- a/strudel.mjs +++ b/strudel.mjs @@ -431,16 +431,16 @@ class Pattern { return fastQuery.withEventTime(t => t.div(factor)) } - fast(factor) { - return this._patternify(Pattern.prototype._fast)(factor) + fast(...factor) { + return this._patternify(Pattern.prototype._fast)(...factor) } _slow(factor) { return this._fast(1/factor) } - slow(factor) { - return this._patternify(Pattern.prototype._slow)(factor) + slow(...factor) { + return this._patternify(Pattern.prototype._slow)(...factor) } _early(offset) { @@ -449,8 +449,8 @@ class Pattern { return this.withQueryTime(t => t.add(offset)).withEventTime(t => t.sub(offset)) } - early(factor) { - return this._patternify(Pattern.prototype._early)(factor) + early(...factor) { + return this._patternify(Pattern.prototype._early)(...factor) } _late(offset) { @@ -459,8 +459,8 @@ class Pattern { } - late(factor) { - return this._patternify(Pattern.prototype._late)(factor) + late(...factor) { + return this._patternify(Pattern.prototype._late)(...factor) } when(binary_pat, func) { diff --git a/test/pattern.test.mjs b/test/pattern.test.mjs index 959727f4..7de9bace 100644 --- a/test/pattern.test.mjs +++ b/test/pattern.test.mjs @@ -98,6 +98,12 @@ describe('Pattern', function() { // .fast(sequence(1,silence) is a quick hack to cut an event in two.. assert.deepStrictEqual(pure("a").fast(sequence(1,4)).firstCycle, stack(pure("a").fast(sequence(1,silence)), sequence(silence, ["a","a"])).firstCycle) }) + it('defaults to accepting sequences', function () { + assert.deepStrictEqual( + sequence(1,2,3).fast(sequence(1.5,2)).firstCycle, + sequence(1,2,3).fast(1.5,2).firstCycle + ) + }) }) describe('_slow()', function () { it('Makes things slower', function () {