Loudness Metering
Test whenever you touch the LUFS DSP (dsp/KWeighting.h, dsp/LoudnessMeter.h), the meter plumbing in Block/OutputBlock, or the Signal section in the options panel.
Prerequisites
- A preset with an Input, at least one Plugin block, and an Output
- An audio source (test tone on the Input block works for all cases)
Test Cases
TC-LM-001: Footer meter tracks output loudness
Steps:
- Start Stellarr with no audio playing
- Observe the OUT meter in the footer
- Enable the test tone on the Input block
Expected: OUT meter is at silence floor when idle; rises to a steady reading when the test tone plays. Reading is stable (not jumpy) because the short-term window averages over 3 s.
TC-LM-002: Selecting a block shows its history strip
Steps:
- Select the Input block
- Observe the Signal section in the options panel
Expected: A 30-second rolling history graph appears. Y-axis shows 0, -18, -30, -60 LUFS labels with dotted grid lines. The polyline plots the block’s recent loudness.
TC-LM-003: Switching selection stops measurement on the previous block
Steps:
- Select a Plugin block; let the history fill with a visible polyline
- Select a different Plugin block
Expected: The first block’s history stops updating (it is no longer measured). The second block starts accumulating its own history from scratch. Only the selected block plus the Output block are actively measured.
TC-LM-004: Meter runs in every bypass mode
Steps:
- Select a Plugin block
- Enable the test tone so there is signal flowing
- Cycle through each bypass mode with bypass ON: Thru, Mute In, Mute Out, Mute, Mute FX In, Mute FX Out
Expected: The history strip updates in every mode. Thru and Mute FX In (with wet tail blended to dry) should read similar to the input; Mute / Mute Out should drop to silence floor; Mute In reads the plugin’s tail (if any) decaying.
Notes: Regression guard — earlier versions skipped the meter entirely when bypassed, so Mute/Mute Out appeared frozen instead of dropping to floor.
TC-LM-005: Target loudness line appears on Output block
Steps:
- Select the Output block
- Enable the target toggle; enter a value (e.g. -18)
- Observe the history strip
Expected: A solid horizontal line appears at -18 LUFS across the graph. The footer OUT meter changes colour based on proximity to the target (under/over).
TC-LM-006: Target loudness persists across preset save/load
Steps:
- Set Output target to -14 LUFS
- Save the preset
- Switch to another preset, then switch back
Expected: Target value is restored to -14. Unsetting the target and saving should omit targetLufs from the JSON (inspect the .stellarr file to confirm).
TC-LM-007: Target loudness defaults to off for presets without the field
Steps:
- Open a preset that pre-dates this feature (no
targetLufskey) - Select the Output block
Expected: Target toggle is off; no target line drawn; no crash or NaN display.
TC-LM-008: Momentary vs short-term window
Steps:
- Open the window selector popup (click the OUT meter in the footer)
- Play the test tone; switch between Momentary (400 ms) and Short-term (3 s)
Expected: Momentary reacts faster to level changes; short-term is smoother. Starting and stopping the test tone should visibly differ in responsiveness between the two modes.
TC-LM-009: Average line on history graph
Steps:
- Select a block and let the history accumulate a mix of loud and quiet periods
- Observe the dashed horizontal line
Expected: Dashed line (average of the history window) sits at the mean of the visible polyline. Moves smoothly as the window rolls.
TC-LM-010: No CPU spike from metering
Steps:
- Note the CPU usage in the footer with metering idle
- Select a block to activate its meter
- Observe CPU usage while the test tone plays
Expected: Enabling measurement on a single block adds a negligible amount of CPU. The K-weighting filter and running-mean computation should not cause noticeable spikes.