Gain Controls
Input and output level management for proper gain staging
Input Gain
The Input Gain is the very first module in TabDSP's signal chain. Its job is simple but critical: normalize the level of whatever audio is playing before it reaches any processing. Hot sources (loud YouTube videos, maximized Spotify tracks) get turned down. Quiet sources (soft podcasts, low-volume streams) get turned up. This ensures every module downstream -- EQ, compressor, limiter -- receives audio at an optimal level.
Range
-24 dB to +24 dB, with a default of 0 dB (unity gain -- no change). The knob displays the current value in dB.
Position in Signal Chain
Input Gain is fixed as the first module. Audio flows through it before reaching the DC blocker, the pre-EQ spectrum analyzer tap, and all processing modules. You cannot reorder it -- it always comes first.
Knob Interaction
- Drag up/down: Adjust gain continuously (0.16 dB per pixel, 300px = full range)
- Scroll wheel: Fine adjustment in 0.5 dB steps
- Arrow Up / Arrow Down: Increase or decrease by 0.5 dB
- PageUp / PageDown: Jump by 3 dB
- Home / End: Jump to minimum (-24 dB) or maximum (+24 dB)
- Double-click: Reset to 0 dB (unity)
Why Gain Staging Matters
Compressors and limiters respond to level. If the input is too hot, the compressor will clamp down harder than intended. If the input is too quiet, it may not engage at all. The EQ spectrum display also benefits from consistent levels -- it is easier to read when the signal sits in a predictable range.
A good target for input levels is -18 to -12 dBFS RMS. This gives processing modules enough headroom to work with while keeping the signal well above the noise floor. Use the input meter on the module block to check your levels.
Gear Head Details: Input Gain Implementation
Input Gain is a Web Audio API GainNode created at chain initialization. The gain value is stored in dB and converted to linear scale using the standard formula:
gainLinear = 10 ^ (gainDb / 20)
Parameter changes use smooth 30ms exponential ramping to prevent clicks and zipper noise during adjustment.
Signal chain detail: The GainNode feeds directly into the input-stage meter (FFT 4096, used for the input level meter), then into a DC-blocking high-pass filter at 5 Hz (Q=0.707), and finally into the pre-EQ analysis tap (FFT 8192, used for the pre-EQ spectrum analyzer). This means the input meter reads the level after gain adjustment, and the spectrum analyzer sees the DC-blocked signal.
Clamping: The value is clamped to [-24, +24] dB on both the UI and DSP sides to prevent extreme gain values.
Master Gain (Output)
The Master Gain is the last module in the signal chain. It controls the final output level after all processing -- EQ, compression, multiband, and limiting -- has been applied. Use it to match the processed output level to the original, or to make final loudness adjustments.
Range
-24 dB to +24 dB, with a default of 0 dB (unity gain). Identical range and resolution to Input Gain.
Position in Signal Chain
Master Gain sits after the limiter and the post-processing analyzer tap, but before the audio reaches the browser's output destination. The LUFS meter taps from the post-processing analyzer (before Master Gain), so Master Gain does not affect LUFS readings.
LUFS meter taps from Post Analyser (parallel) -- not affected by Master Gain
Knob Interaction
Identical to Input Gain:
- Drag up/down: Adjust gain continuously (0.16 dB per pixel)
- Scroll wheel: Fine adjustment in 0.5 dB steps
- Arrow Up / Arrow Down: Increase or decrease by 0.5 dB
- PageUp / PageDown: Jump by 3 dB
- Home / End: Jump to minimum (-24 dB) or maximum (+24 dB)
- Double-click: Reset to 0 dB (unity)
Master Gain sits after the limiter. If you boost here, you can push levels above the limiter's ceiling, potentially causing clipping at the browser's output stage. The limiter cannot protect against gain added after it. Keep Master Gain at 0 dB or below unless you have a specific reason to boost, and monitor the output meter carefully if you do.
Gear Head Details: Master Gain Implementation
Like Input Gain, Master Gain is a GainNode with the same dB-to-linear conversion and 30ms exponential ramp smoothing. The key architectural difference is its position in the graph.
Signal chain detail: The signal flows from the limiter bypass sum through the output-stage analysis tap (FFT 4096, used for the output level meter) and then into the master output gain. The master output connects directly to the AudioContext destination (the browser's audio output).
LUFS measurement: The LUFS meter worklet taps from the output analysis point in parallel -- it receives audio before Master Gain is applied. This means LUFS readings reflect the post-limiter signal, not the final output level. For broadcast compliance checking, this is the correct measurement point: it shows the level that your processing chain produces, independent of any final volume adjustment.
Broadcast compliance implication: If you are targeting a specific LUFS standard (such as -14 LUFS for streaming or -23 LUFS for EBU R128), the LUFS meter will show the correct value regardless of your Master Gain setting. However, if Master Gain is not at 0 dB, the actual output level delivered to the listener will differ from what the LUFS meter shows.
Gain Staging Guide
Good gain staging means setting appropriate levels at each point in the signal chain so that every module operates in its sweet spot. Here is a quick reference for optimal levels at each stage.
| Stage | Target Level | Why |
|---|---|---|
| After Input Gain | -18 to -12 dBFS RMS | Gives processing modules headroom to boost without clipping |
| After EQ | Within 6 dB of input | Large EQ boosts can push levels into compressor too hard |
| After Compressor | Similar to pre-compression | Makeup gain should restore level, not add loudness |
| Into Limiter | Peaks at -3 to 0 dBFS | Limiter catches peaks; excessive input causes audible pumping |
| Master Gain | 0 dB (unity) | Preserves limiter ceiling; adjust only if matching external levels |
Common Scenarios
Hot YouTube audio (peaking near 0 dBFS):
- Set Input Gain to -6 to -12 dB to bring peaks down
- Watch the input meter -- aim for peaks around -12 dBFS
- Leave Master Gain at 0 dB
Quiet podcast or low-volume stream:
- Set Input Gain to +6 to +12 dB to bring levels up
- The compressor will now engage properly on the louder signal
- If the output is too loud after processing, reduce Master Gain rather than Input Gain
A/B comparison (processed vs. original):
- Processing often makes audio louder, which tricks you into thinking it sounds better
- Use Master Gain to match the processed output level to the bypassed level
- Toggle the global enable/disable to compare at matched loudness
Think of Input Gain as "how hard you drive the processing" and Master Gain as "how loud the result is." Turning Input Gain up makes compressors and limiters work harder, changing the character of the sound. Turning Master Gain up just makes the final output louder without affecting processing behavior. For the most control, adjust Input Gain first to get the processing response you want, then use Master Gain to set the final output level.
Parameter Reference
| Parameter | Range | Default | Description |
|---|---|---|---|
| Input Gain | -24 dB to +24 dB | 0 dB | Pre-processing level control (first in chain) |
| Master Gain | -24 dB to +24 dB | 0 dB | Post-limiter output level control (last in chain) |
| Interaction | Action |
|---|---|
| Drag up/down | Continuous adjustment (0.16 dB/px) |
| Scroll wheel | 0.5 dB steps |
| Arrow Up / Down | 0.5 dB steps |
| PageUp / PageDown | 3 dB steps |
| Home / End | Jump to -24 dB / +24 dB |
| Double-click | Reset to 0 dB |