Skip to content

feat(processor,ui): migrate LUFS target to -16 and add LUFS value to filenames#54

Merged
flexiondotorg merged 7 commits intomainfrom
lufs
Mar 14, 2026
Merged

feat(processor,ui): migrate LUFS target to -16 and add LUFS value to filenames#54
flexiondotorg merged 7 commits intomainfrom
lufs

Conversation

@flexiondotorg
Copy link
Contributor

Summary

Migrate the loudness normalisation target from -18 to -16 LUFS and enhance output filenames to include the final measured LUFS value. These changes align the codebase with expert guidance on podcast loudness standards and provide users with immediate visibility of achieved loudness.

Changes

LUFS Target Migration (-18 → -16)

  • Update NormTargetLUFS constant and all defaults in internal/processor/filters.go
  • Replace hardcoded LUFS target values with constant references in internal/processor/adaptive.go and internal/logging/recording_tips.go
  • Update gain calculations and comments across processor and logging packages

Output Filename Enhancement

  • Implement post-processing rename to include measured LUFS: <name>-LUFS-NN-processed.<ext>
  • NN is final integrated loudness rounded to nearest integer (e.g., -15.8 LUFS → LUFS-16)
  • Fix OutputPath propagation in TUI model for correct filename display on completion
  • Update test cleanup to handle both old and new filename patterns

User-Facing Updates

  • Display input filename during active processing (output filename unknown until completion)
  • Update all documentation (README, AGENTS.md, technical docs) to reflect -16 LUFS target
  • Clarify EBU R128 distinction in comparison documentation (-23 LUFS standard vs -16 LUFS podcast target)

Testing

  • All existing tests pass (just test)
  • Full grep audit confirms no stale LUFS target references remain
  • Verified all remaining "-18" references are correctly LA-2A thresholds (dB RMS), test inputs, or unrelated metrics
  • Build successful with clean compilation

Related Issues

Implements expert guidance on podcast loudness standards.

Update NormTargetLUFS constant, filter defaults, level meter boundary,
and test comments to reflect new target loudness of -16 LUFS for podcast
normalisation.

Signed-off-by: Martin Wimpress <code@wimpress.io>
…argetLUFS constant

- Replace hardcoded -18.0 in LUFS gap calculation with NormTargetLUFS
  constant
- Update recording tips gain calculations to use NormTargetLUFS
- Update comments referencing old -18 LUFS target
- Update test expectations for gain values (2 dB shift reflects new -16
  LUFS target)

Prevents future drift by centralising the LUFS target constant.

Signed-off-by: Martin Wimpress <code@wimpress.io>
Output files now follow the pattern `<name>-LUFS-NN-processed.<ext>`
where NN is the final measured integrated loudness rounded to the
nearest whole number.

- Implement post-processing rename in ProcessAudio after LUFS
  measurement
- Add generateLUFSOutputPath helper for filename generation
- Fix OutputPath propagation in TUI model on file completion
- Update TUI active display to show source filename (LUFS unknown during
  processing)
- Update test cleanup to handle both old and new filename patterns
- Update comments and documentation for new naming convention

Provides users with immediate visibility of achieved loudness in the
filename.

Signed-off-by: Martin Wimpress <code@wimpress.io>
Update all user-facing and technical documentation to reflect the new
-16 LUFS loudness target for podcast normalisation:

- README.md: update target and output filename examples
- AGENTS.md, CLAUDE.md: update project overview
- Spectral-Metrics-Reference.md: update RMS guidance
- Levelator-Comparison-And-Gap-Analysis.md: fix EBU R128 conflation
  (clarify EBU R128 is -23 LUFS; jivetalking targets -16 LUFS for
  podcasts)

Signed-off-by: Martin Wimpress <code@wimpress.io>
Display the input filename directly without arrow or output name, since
the final LUFS-aware output filename is unknown until processing
completes.

Signed-off-by: Martin Wimpress <code@wimpress.io>
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 15 files

Confidence score: 4/5

  • This PR looks safe to merge with minimal risk: all reported issues are low-severity documentation/comment accuracy problems rather than runtime behavior regressions.
  • The most significant issue is in README.md, where calling -16 LUFS a podcast/broadcast standard is factually incorrect and could mislead users about loudness targets.
  • internal/processor/normalise.go and docs/Levelator-Comparison-And-Gap-Analysis.md contain wording/stage-label mismatches that can confuse maintenance and expectations, but they do not indicate functional breakage.
  • Pay close attention to README.md, internal/processor/normalise.go, and docs/Levelator-Comparison-And-Gap-Analysis.md - align LUFS terminology and processing-stage descriptions to avoid reader confusion.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="internal/processor/normalise.go">

<violation number="1" location="internal/processor/normalise.go:116">
P3: This parameter comment names the wrong file stage: normalisation reads the intermediate `-processed` output, and the `-LUFS-NN-processed` rename happens afterward.</violation>
</file>

<file name="README.md">

<violation number="1" location="README.md:9">
P2: `-16 LUFS` is a podcast target, not the broadcast standard; calling it the "podcast/broadcast standard" is factually inaccurate.</violation>
</file>

<file name="docs/Levelator-Comparison-And-Gap-Analysis.md">

<violation number="1" location="docs/Levelator-Comparison-And-Gap-Analysis.md:77">
P3: This sentence now misstates the target as `broadcast-ready`: the same document later correctly says EBU R128 broadcast loudness is -23 LUFS, while Jivetalking targets -16 LUFS for podcasts.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 1 file (changes from recent commits).

Requires human review: Auto-approval blocked by 2 unresolved issues from previous reviews.

- Correct README "podcast/broadcast standard" to "common podcast target"
  (broadcast standards are -23/-24 LUFS, not -16)
- Fix normalise.go comments: reference intermediate -processed path,
  not post-rename filename (LUFS rename happens in ProcessAudio)

Signed-off-by: Martin Wimpress <code@wimpress.io>
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 2 files (changes from recent commits).

Requires human review: This PR modifies core processing targets (-18 to -16 LUFS) and changes the output filename convention, which are significant functional changes requiring human review.

@flexiondotorg flexiondotorg merged commit c2bfb7c into main Mar 14, 2026
7 checks passed
@flexiondotorg flexiondotorg deleted the lufs branch March 14, 2026 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant