mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-11 13:48:40 +00:00
Fix for squeezejoin and functions using it, including bite (#1286)
This commit is contained in:
parent
3575fc3cc8
commit
84581b22aa
@ -1820,7 +1820,10 @@ export const { fastGap, fastgap } = register(['fastGap', 'fastgap'], function (f
|
||||
export const focus = register('focus', function (b, e, pat) {
|
||||
b = Fraction(b);
|
||||
e = Fraction(e);
|
||||
return pat._fast(Fraction(1).div(e.sub(b))).late(b.cyclePos());
|
||||
return pat
|
||||
._early(b.sam())
|
||||
._fast(Fraction(1).div(e.sub(b)))
|
||||
._late(b);
|
||||
});
|
||||
|
||||
export const { focusSpan, focusspan } = register(['focusSpan', 'focusspan'], function (span, pat) {
|
||||
|
||||
@ -1265,4 +1265,14 @@ describe('Pattern', () => {
|
||||
expect(s('bev').chop(8).loopAt(2)._steps).toStrictEqual(Fraction(4));
|
||||
});
|
||||
});
|
||||
describe('bite', () => {
|
||||
it('works with uneven patterns', () => {
|
||||
sameFirst(
|
||||
fastcat(slowcat('a', 'b', 'c', 'd', 'e'), slowcat(1, 2, 3, 4, 5))
|
||||
.bite(2, stepcat(pure(0), pure(1).expand(2)))
|
||||
.fast(5),
|
||||
stepcat(slowcat('a', 'b', 'c', 'd', 'e'), slowcat(1, 2, 3, 4, 5).expand(2)).fast(5),
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user