mirror of
https://codeberg.org/armin/beamgrid.git
synced 2026-09-01 04:10:47 +02:00
Add TILT spectral-tilt knob plus grid zoom/fade and curving controls
- TILT knob (-1..1, 0=flat) boosts highs / cuts lows about the log-frequency centre so high frequencies become more visible in the display - Add GRID ZOOM, GRID FADE, and CURVING knobs; refine BARS/LEDS snapping - Fix README MODE knob placement description
This commit is contained in:
parent
b6bdc73488
commit
ca9555af13
7 changed files with 176 additions and 15 deletions
|
|
@ -95,7 +95,14 @@ void Analyser::computeFFT()
|
|||
// to ~full scale, otherwise the raw magnitudes sit ~66 dB too hot.
|
||||
const double normalized = avg / static_cast<double> (fftSize);
|
||||
const double db = 20.0 * std::log10 (normalized + 1e-9);
|
||||
double norm = (db - minDb) / (maxDb - minDb);
|
||||
|
||||
// Spectral tilt: boost highs / cut lows (or the reverse) about the
|
||||
// logarithmic centre of the spectrum. The per-band fraction spans
|
||||
// 0 (lowest band) to 1 (highest band), so (frac - 0.5) * 2 is -1..+1.
|
||||
const double frac = (static_cast<double> (b) + 0.5) / numBands;
|
||||
const double tiltDb = tilt * (frac - 0.5) * 2.0 * maxTiltDb;
|
||||
|
||||
double norm = (db + tiltDb - minDb) / (maxDb - minDb);
|
||||
norm = juce::jlimit (0.0, 1.0, norm);
|
||||
|
||||
targets[b] = static_cast<float> (norm);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue