AmpProcessor

A gain stage that scales its input by a percentage and a boost in decibels.

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

Detailed description

The node has two node parameters. Percentage scales the signal from 0 to 100 percent. Decibel adds a boost from 0 to +48 dB. The two multiply into one linear gain, and the gain moves toward a new value over 5 ms, so a change does not click.

Member function documentation

setSampleRate

[override virtual] void AmpProcessor::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