From f533e4a5d0bab2166b66aa30732bff04d5a6829d Mon Sep 17 00:00:00 2001 From: Bradford Powell Date: Mon, 1 Aug 2022 19:35:15 -0400 Subject: [PATCH] Change offset for "stateful random" streams This would no longer match with Tidal (which uses 0.0001), but reduces the correlation among the the different random streams in the mini-notation's parsing of ? and | --- packages/mini/mini.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/mini/mini.mjs b/packages/mini/mini.mjs index 2a7bd077..c6b1d50e 100644 --- a/packages/mini/mini.mjs +++ b/packages/mini/mini.mjs @@ -28,7 +28,7 @@ const applyOptions = (parent) => (pat, i) => { case 'bjorklund': return pat.euclid(operator.arguments_.pulse, operator.arguments_.step, operator.arguments_.rotation); case 'degradeBy': - return reify(pat)._degradeByWith(strudel.rand.early(0.0001 * _nextSeed()).segment(1), operator.arguments_.amount); + return reify(pat)._degradeByWith(strudel.rand.early(Math.PI * _nextSeed()).segment(1), operator.arguments_.amount); // TODO: case 'fixed-step': "%" } console.warn(`operator "${operator.type_}" not implemented`); @@ -91,7 +91,7 @@ export function patternifyAST(ast) { return stack(...children); } if (alignment === 'r') { - return strudel.chooseInWith(strudel.rand.early(0.0001 * _nextSeed()).segment(1), children); + return strudel.chooseInWith(strudel.rand.early(Math.PI * _nextSeed()).segment(1), children); } const weightedChildren = ast.source_.some((child) => !!child.options_?.weight); if (!weightedChildren && alignment === 't') {