wnoise function
1D value noise in -1, 1 whose lattice wraps every period cells.
Implementation
double wnoise(double x, int period, [int seed = 0]) {
final i = x.floor();
final f = x - i;
final u = f * f * (3.0 - 2.0 * f);
final a = rand(wrapInt(i, period), seed);
final b = rand(wrapInt(i + 1, period), seed);
return (a + (b - a) * u) * 2.0 - 1.0;
}