lcgNoise static method
Implementation
static Float32List lcgNoise(
int n, {
double amplitude = 1.0,
int seed = 123456789,
}) {
int x = seed & 0x7fffffff;
const int a = 1103515245;
const int c = 12345;
const int m = 0x7fffffff;
double next() {
x = (a * x + c) & m;
return x / m;
}
final out = Float32List(n);
for (int i = 0; i < n; i++) {
out[i] = (amplitude * (2.0 * next() - 1.0));
}
return out;
}