4.9.4.2 noise - noise( x )

The noise function returns a random value between -1 and 1 for any given argument. When the argument is a constant, also the output of the noise function will be a constant. When you use an increasing argument such as "time" you will get a noisy curve which will have slightly changes from value to value rasulting in a smoother noise curve as the random functions return.

sphere.YPosition = noise( time );

This will result in a noisy curve:

Since the noise function always returns the same value for the same argument, you can change the area of the noise when you offset the argument:

sphere.YPosition = noise( time + 2 );

Now the curve from the first example is shifted to the left - the function returns a different area of the noisy curve.

To get a repetitive noise just choose a repetetive argument like a sine function:

sphere.YPosition = noise( sin( time * 180 ) );

Now you get a cycled noise which repeats all two seconds.

Xpressionist 3.5