function [r, state] = cymbal_rngv(state) % CYMBAL_RNGV Vectorized seeded uniform generator: one 32-bit LCG stream per % element of `state`, all advanced by one step. Returns the uniforms in (0, 1) % and the advanced state, both the same shape as the input. % % The scalar cymbal_rng draws a sequence from one stream, which is what the % stroke process wants. The cascade wants one fresh number per mode per % control frame, hundreds of thousands of them, so it runs hundreds of % independent streams side by side instead of looping. Every product below % stays under 2^53 (2^32 * 1664525 < 2^53), so the arithmetic is exact in the % CLI, in Node and in the browser alike, and a given seed reproduces the % identical render everywhere. state = mod(state * 1664525 + 1013904223, 4294967296); r = (state + 0.5) / 4294967296; end