mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-26 13:08:28 +00:00
Allow linger to accept non-fractions
This commit is contained in:
parent
dcc5f66691
commit
ec3371c4ff
@ -706,6 +706,8 @@ class Pattern {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_zoom(s, e) {
|
_zoom(s, e) {
|
||||||
|
e = Fraction(e)
|
||||||
|
s = Fraction(s)
|
||||||
const d = e.sub(s);
|
const d = e.sub(s);
|
||||||
return this.withQuerySpan((span) => span.withCycle((t) => t.mul(d).add(s)))
|
return this.withQuerySpan((span) => span.withCycle((t) => t.mul(d).add(s)))
|
||||||
.withEventSpan((span) => span.withCycle((t) => t.sub(s).div(d)))
|
.withEventSpan((span) => span.withCycle((t) => t.sub(s).div(d)))
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import Fraction from 'fraction.js';
|
import Fraction from 'fraction.js';
|
||||||
|
|
||||||
import { strict as assert } from 'assert';
|
import { deepStrictEqual, strict as assert } from 'assert';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
TimeSpan,
|
TimeSpan,
|
||||||
@ -656,4 +656,12 @@ describe('Pattern', function () {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
describe('linger', () => {
|
||||||
|
it('Can linger on the first quarter of a cycle', () => {
|
||||||
|
assert.deepStrictEqual(
|
||||||
|
sequence(0, 1, 2, 3, 4, 5, 6, 7).linger(0.25).firstCycle(),
|
||||||
|
sequence(0, 1, 0, 1, 0, 1, 0, 1).firstCycle(),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user