4ddcc1bCymbal simulator: shell-of-revolution modal model with a nonlinear energy cascade, numbl MATLAB reference, and interactive web appJeremy Magland 1function [r, state] = cymbal_rng(state, n)
2% CYMBAL_RNG Portable seeded uniform generator (32-bit LCG).
3% Returns n uniforms in (0, 1) as a column vector, plus the advanced state.
4% Deliberately not MATLAB's rand: the same seed must produce the identical
5% strike pattern in the numbl CLI, Node, and the browser, and every double
6% here stays below 2^53 so the arithmetic is exact everywhere.
7r = zeros(n, 1);
8for i = 1:n
9 state = mod(state * 1664525 + 1013904223, 4294967296);
10 r(i) = (state + 0.5) / 4294967296;
11end
12end