mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-11 13:48:40 +00:00
pass all the args through patternify, to properly support sequences as args
This commit is contained in:
parent
89ee94e953
commit
d6c22d516b
16
strudel.mjs
16
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) {
|
||||
|
||||
@ -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 () {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user