feat(library): album loudness from the tracks' summed block histograms (M464 #4996)
release / govulncheck (push) Successful in 27s
release / web (push) Successful in 1m27s
release / go (push) Successful in 1m47s
release / integration (push) Successful in 4m51s
release / android (push) Successful in 6m23s
release / Build signed APK (releases and dev) (push) Successful in 6m25s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 1m30s
release / Verify release artifacts (tag releases only) (push) Skipped
release / govulncheck (push) Successful in 27s
release / web (push) Successful in 1m27s
release / go (push) Successful in 1m47s
release / integration (push) Successful in 4m51s
release / android (push) Successful in 6m23s
release / Build signed APK (releases and dev) (push) Successful in 6m25s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 1m30s
release / Verify release artifacts (tag releases only) (push) Skipped
Album-mode normalization plays a whole album at one gain. That gain comes from album_loudness (migration 0066): BS.1770's gated loudness over every block on the album, computed by summing the tracks' stored histograms and gating the sum. No audio is decoded again. Album true peak is the loudest track's. - Recomputed by the loudness worker each tick, after the track pass and whether or not analysis is switched on. ListAlbumsNeedingLoudness lists albums whose md5 over (present track id, measurement version and time) no longer matches the stored digest. One comparison covers every way membership changes (scan retag, duplicate merge, delete, missing and restored) without hooking each. - No album value until every present track has a settled measurement, so an album's gain doesn't shift mid-listen as the rest is measured. Silent and unreadable tracks count as settled. - Rows for albums with no present track left are dropped. - The parser and the merge share trimBins. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
-- 0066_album_loudness.up.sql — album loudness for album-mode normalization
|
||||
-- (Scribe milestone #464, #4996).
|
||||
--
|
||||
-- An album's loudness is the gated loudness of every 400 ms block on the album,
|
||||
-- not an average of its tracks' values: a quiet interlude and a loud single
|
||||
-- should keep their difference when the album plays in order. It is computed
|
||||
-- from the per-track block histograms in track_loudness (0065), summed, so no
|
||||
-- audio is decoded again.
|
||||
--
|
||||
-- A derived value, recomputed by the loudness worker whenever its inputs
|
||||
-- change. inputs_digest is an md5 over the album's present tracks and the
|
||||
-- measurement each holds; the worker recomputes every album whose stored digest
|
||||
-- no longer matches. That one comparison covers every way membership changes
|
||||
-- (a scan moving a track between albums, a duplicate merge, a delete, a file
|
||||
-- going missing or coming back) without hooking each of them.
|
||||
CREATE TABLE album_loudness (
|
||||
album_id uuid PRIMARY KEY REFERENCES albums (id) ON DELETE CASCADE,
|
||||
-- NULL until every present track has a settled measurement: an album
|
||||
-- leveled from half its tracks would jump when the rest arrived. Also NULL
|
||||
-- for an album with no block above the gate. Clients fall back to track
|
||||
-- gain while it is NULL.
|
||||
integrated_lufs real,
|
||||
-- The loudest true peak of any track on the album, so album gain is held
|
||||
-- to the headroom of its loudest track.
|
||||
true_peak_dbtp real,
|
||||
tracks_total integer NOT NULL,
|
||||
-- Tracks with a settled measurement (measured, silent or unreadable).
|
||||
tracks_settled integer NOT NULL,
|
||||
inputs_digest text NOT NULL,
|
||||
computed_at timestamptz NOT NULL DEFAULT now()
|
||||
);
|
||||
Reference in New Issue
Block a user