Models a VU meter with smoothing.
Supports peak and RMS (root-mean-square) metering. Usage example for a strip of lights with 3dB increments:
vuMeter.process(deltaTime, output);
for (int i = 0; i < 6; i++) {
float b = vuMeter.getBrightness(-3.f * (i + 1), -3.f * i);
lights[i].setBrightness(b);
}
float rack::dsp::VuMeter2::getBrightness |
( |
float | dbMin, |
|
|
float | dbMax ) |
|
inline |
Returns the LED brightness measuring tick marks between dbMin and dbMax.
For example, getBrightness(-6.f, 0.f)
will be at minimum brightness at -6dB and maximum brightness at 0dB. Set dbMin == dbMax == 0.f for a clip indicator that turns fully on when db >= dbMax. Expensive, so call this infrequently.