6 float Noise_Brown(entity e, float dt)
8 e.noise_baccum += random() * sqrt(dt); // same stddev for all dt
11 float Noise_Pink(entity e, float dt)
15 // http://home.earthlink.net/~ltrammell/tech/pinkalg.htm
16 if(random() > pow(0.3190, f))
17 e.noise_paccum = 0.34848 * (2 * random() - 1);
18 if(random() > pow(0.7756, f))
19 e.noise_paccum2 = 0.28768 * (2 * random() - 1);
20 if(random() > pow(0.9613, f))
21 e.noise_paccum3 = 0.43488 * (2 * random() - 1);
22 return e.noise_paccum + e.noise_paccum2 + e.noise_paccum3;
24 float Noise_White(entity e, float dt)
26 return random() * 2 - 1;
28 float Noise_Burst(entity e, float dt, float p)
30 if(random() > pow(p, dt))
31 e.noise_bstate = !e.noise_bstate;
32 return 2 * e.noise_bstate - 1;