From e0344dbd67c741a4586e0d345bf4cbe85d43d4c6 Mon Sep 17 00:00:00 2001 From: Aria Date: Sat, 13 Dec 2025 17:49:19 -0600 Subject: [PATCH] Simple seeding for this first iteration --- packages/core/signal.mjs | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/packages/core/signal.mjs b/packages/core/signal.mjs index a56009add..c7e143ae6 100644 --- a/packages/core/signal.mjs +++ b/packages/core/signal.mjs @@ -359,7 +359,7 @@ export const binaryNL = (n, nBits = 16) => { * .partials(randL(8)) */ export const randL = (n) => { - return signal((t) => (nVal) => timeToRands(t, nVal).map(Math.abs)).appLeft(reify(n)); + return signal((t) => (nVal) => getRandsAtTime(t, nVal).map(Math.abs)).appLeft(reify(n)); }; export const randrun = (n) => { @@ -434,19 +434,6 @@ export const withSeed = (func, pat) => { * $: s("bd*4").degrade().seed(1); // Will degrade different events from the hi-hat */ export const seed = register('seed', (n, pat) => { - return withSeed((prev) => (prev !== undefined ? randAt(prev, n) * Number.MAX_SAFE_INTEGER : n), pat); -}); - -/** - * Set the seed for random signals. Differs from `seed` in that `seed` can be used - * multiple times with the final signal depending on all seeds. `setSeed` on the - * other hand overwrites the previous calls to `seed`. - * - * @name setSeed - * @param {number} n An arbitrary number to be used as the new seed. 0 is the same - * as the default random behavior. - */ -export const setSeed = register('setSeed', (n, pat) => { return withSeed(() => n, pat); });