Here is (or will be when I write this page) a method of generating a slowly and randomly varying waveform. This can be used to drive the random motion of a boat bobbing up and down on the water, data for an ambient motion loop, and many other things, inside and outside of Second Life.

The general method is to start with a sequence of independent random numbers, such as provided by llFrand(). These will not be suitable themselves, as they jump around too fast.

Let the values be *x _{1}*,

*x*,

_{2}*x*, …

_{3}
Define a new sequence *y _{1}*,

*y*,

_{2}*y*, … by the rule

_{3}*y*=

_{n}*a y*+

_{n–1}*b x*. If

_{n}*a*is very close to 1 and

*b*is very close to 0, then

*y*will only vary a little from

_{n}*y*. This waveform, however, still has too much jumpiness.

_{n–1}
Repeat the process, defining *z _{1}*,

*z*,

_{2}*z*, … by the rule

_{3}*z*=

_{n}*c z*+

_{n–1}*d y*, again choosing

_{n}*c*close to 1 and

*d*close to 0.

You can usefully do this a third time: *w _{n}* =

*e w*+

_{n–1}*f z*. Three of these smoothings is enough: if you plot a graph of these waveforms over time, the fourth smoothing looks no different from the third.

_{n}
Then you need to choose the multipliers *a*…*f* to ensure that the amplitude of the waveform and the speed at which it changes meet your requirements. That involves some mathematics that I haven’t worked out yet. I just tuned them by hand.

The gondola that bobs gently up and down outside the Palazzo Bovolo uses six of these generators, one for each component of position and orientation.