Merge branch 'main' into get-control

This commit is contained in:
Felix Roos 2025-01-29 15:31:33 +01:00
commit 81e97a5643
No known key found for this signature in database
97 changed files with 7465 additions and 6404 deletions

View file

@ -31,11 +31,11 @@
},
"homepage": "https://strudel.cc",
"dependencies": {
"fraction.js": "^4.3.7"
"fraction.js": "^5.2.1"
},
"gitHead": "0e26d4e741500f5bae35b023608f062a794905c2",
"devDependencies": {
"vite": "^5.0.10",
"vitest": "^2.1.3"
"vite": "^6.0.11",
"vitest": "^3.0.4"
}
}

View file

@ -3119,9 +3119,9 @@ Pattern.prototype.xfade = function (pos, b) {
* especially useful for creating rhythms
* @name beat
* @example
* s("bd").beat("0:7:10", 16)
* s("bd").beat("0,7,10", 16)
* @example
* s("sd").beat("4:12", 16)
* s("sd").beat("4,12", 16)
*/
const __beat = (join) => (t, div, pat) => {
t = Fraction(t).mod(div);

View file

@ -530,7 +530,7 @@ export const undegrade = register('undegrade', (pat) => pat._undegradeBy(0.5), t
export const sometimesBy = register('sometimesBy', function (patx, func, pat) {
return reify(patx)
.fmap((x) => stack(pat._degradeBy(x), func(pat)._undegradeBy(1 - x)))
.fmap((x) => stack(pat._degradeBy(x), func(pat._undegradeBy(1 - x))))
.innerJoin();
});

View file

@ -53,7 +53,6 @@ import {
stackCentre,
s_cat,
calculateTactus,
sometimes,
} from '../index.mjs';
import { steady } from '../signal.mjs';
@ -1267,13 +1266,4 @@ describe('Pattern', () => {
expect(s('bev').chop(8).loopAt(2).tactus).toStrictEqual(Fraction(4));
});
});
describe('sometimes', () => {
it('works with constant functions', () => {
expect(
pure('a')
.sometimes((x) => pure('b'))
.fast(16).firstCycleValues.length,
).toStrictEqual(16);
});
});
});