NoiseProcessor

A white noise source that a note switches on and off.

Declared in src/libs/libbahn/bahn/tracker/processor/NoiseProcessor.hpp
Inherits Processor
Group bahn

Detailed description

Any note switches the noise on, and a note off switches it off. The Volume parameter sets the level. The level moves toward its target over 5 ms, so the noise does not click when it starts or stops. An xorshift32 generator makes the samples.

Member function documentation

setSampleRate

[override virtual] void NoiseProcessor::setSampleRate(int rate)

Follow the device: rate is the sample rate of the output device, in Hz. A rate of zero or less, or a rate equal to the current one, changes nothing.

Called by BahnPlayer::broadcastSampleRate once the speaker's format is known. ProcessorFactory builds every processor at bahn::DEFAULT_SAMPLE_RATE before the device is open, so without this the node stays at 44100 whatever the hardware is doing.

In this section