A simple random-noise implementation

The Noise suite implements a basic colored noise synthesis algorithm, along with its associated handler and actor. The noise is random, or repetitive, in nature. (Actually, it repeats once every 2^48 samples, or at worst, once every 203 years at 44.1 kHz sampling rate. So, who's counting?) The noise is colored by filtering through a selectable zero-order or first-order hold process.

Noise characteristics are controlled through two parameters: "Order", and "Cutoff". Order determines the filter type used for coloring the noise. Order=0 corresponds to a simple zero-order hold (i.e. sampled-and-held noise samples), while Order=1 corresponds to a first-order hold (i.e. linearly interpolated noise samples). Both types of filtering are lowpass in nature, with a falloff slope of 6dB/octave for Order=0 and 12dB/octave for Order=1.

Cutoff controls the frequency at which the noise spectrum falls off, i.e., is filtered out, and is expressed in Hz. Specifically, a cutoff of 1000Hz produces an output spectrum whose half-power point occurs at 443Hz for Order=0, and at 319Hz for Order=1.

To use the Noise implementation, load noise.so and create an actor of type NoiseActor.

NoiseActor messages

In addition to the messages understood by all generator actors, the NoiseActor understands the following messages:
SetCutoff hActor x
Set the default cutoff frequency for new instances created by this actor to x.
SetAllCutoff hActor x time
Set the cutoff frequency of all children to x, and set the default cutoff for all future children. If time is specified, children will modulate to the new cutoff over the specified duration. Default cutoff is always set immediately regardless of time.
SetOrder hActor bool
Set the default filter order for new instances created by this actor to bool, either 0 or 1.
SetAllOrder hActor bool
Set the filter order of all children to bool, and set the default order for all future children.

Noise handler messages

In addition to the messages understood by all handlers, the handler for the noise algorithm understands the following messages:
SetCutoff hSound x time
Set the cutoff frequency to x. If time is specified, move to the new cutoff over the specified duration.
SetOrder hSound bool
Set the filter order to bool, either 0 or 1.