Commit b40c7fb5 by PLN (Algolia)

docs+feat(cosmicfest): log 038, the stem EDA, and a finisher that does not need my session

Log 038 — "A record from one microphone" — is the night CosmicFest went from
"educated guess game", PLN's phrase, to a pipeline. It carries the measurements
that reshaped the job and a correction to my own previous commit.

eda_stems.py is the mastering EDA a stemless gig could not otherwise have, and it
exists to answer three specific questions rather than to print statistics.

Is the 8-16 kHz deficit cymbals or codec noise? The master measured 0.12% of
total energy up there and the air shelf was deliberately held to +5 dB instead of
the +12 the deficit suggests, because a 320 kbps MP3 puts hiss in that band
alongside hats. A broadband boost cannot tell the two apart; a per-stem view can.
If the HF lives in `drums` it is cymbals and the shelf can open, and if it is
spread evenly across all four it is noise and the shelf stays shut.

Where is the kick? project_floor_problem measured the kick audible in only 59% of
OPAL-26, from real orbit stems. This asks the same question of a gig that has
none, via 40-120 Hz activity over time, thresholded relative to each track's own
p95 rather than an absolute dBFS — a fixed threshold on a quiet room-coloured
source measures the recording level, not the kick. Reported per track so a floor
that drops out gets named instead of averaged away.

And how much does local-versus-global separation actually differ? It compares
each section's stem against the same span cut out of the global stem:
correlation says whether the model made the same decision, the RMS delta says
whether normalisation changed the level. That comparison is the reason the
chunked writer had to be length-exact.

Presence is gated before any stem is compared to another, and demucs' own source
names are treated as hypotheses — feedback_label_and_lens applies to a
separator's labels as much as to a sample's filename.

finish_cosmic.sh + cosmic-finish.service exist because of a structural mistake I
nearly shipped. The master and demucs runs are systemd units so they outlive the
session, but every step AFTER them — split, verify, EDA — was sitting in my
session. PLN said "your autonomous now going to bed tell me results tomo", so a
teardown would have left him with rendered masters and nothing else. The unit is
ordered After= both producers, so systemd does the waiting instead of a polling
loop, and it leaves FINISH_SUMMARY.txt on disk that stands on its own. Wants=
rather than Requires=, deliberately: a club-target miss or a demucs failure must
not cancel the split of a perfectly good streaming master.

The log also corrects commit 37eb401f, which claimed the chunked demucs path was
about twice as fast. It is not, and the claim came from a broken metric: I counted
directories under stems_demucs/sections/, but a directory appears the moment
chunked_separate opens its writers, so the count measures sections STARTED, not
finished. libsndfile buffers on top of that, so three of four in-flight sections
sat at 44 bytes — a bare WAV header — after nine minutes of genuine work.
Measured properly by mtime and flushed bytes, a worker runs at about 4.3x
realtime under four-way contention plus the master render. Chunking fixed the
OOM kill; it did not demonstrably make anything faster.
parent 6ae2b820
#!/usr/bin/env bash
# finish_cosmic — everything downstream of the masters, unattended.
#
# PLN went to bed with "your autonomous now going to bed tell me results tomo".
# The master and demucs runs are systemd units so they outlive the session, but
# the steps AFTER them were sitting in my session — which means a teardown would
# have left him with rendered masters and nothing else. So the rest is a unit
# too: it waits for the masters, splits the album, runs the stem EDA, and leaves
# a summary on disk that stands on its own.
#
# Ordered after cosmic-master.service in the unit file, so systemd does the
# waiting rather than a polling loop.
set -uo pipefail
TT=/home/pln/Work/Sound/Tidal/armada/tide-table
SPEC=$TT/judge_specs/cosmicfest-2026.json
ROOT=/home/pln/Work/Sound/Prod/Cosmic26_master
PY=/home/pln/Work/Sound/tidal-ears/.venv/bin/python
SUM=$ROOT/FINISH_SUMMARY.txt
exec > >(tee -a "$SUM") 2>&1
echo "=============================================================="
echo "finish_cosmic $(date -Is)"
echo "=============================================================="
if [ ! -f "$ROOT/Cosmic26_v1_streaming.flac" ]; then
echo "FATAL: no streaming master — the master unit did not produce one."
exit 1
fi
echo
echo "--- masters on disk ---"
for f in "$ROOT"/Cosmic26_v1_*.flac; do
[ -e "$f" ] || continue
printf '%s %s ' "$(basename "$f")" "$(du -h "$f" | cut -f1)"
ffprobe -v error -show_entries format=duration -of csv=p=0 "$f"
done
# The club variant may legitimately be absent: its loudness target can be
# unreachable on this source, and master_stemless reports the miss rather than
# clipping to a number. Split whatever actually exists.
echo
echo "--- split + verify ---"
"$PY" "$TT/render_release.py" "$SPEC" --only split
"$PY" "$TT/render_release.py" "$SPEC" --only verify
echo
echo "--- stem EDA (needs the demucs unit to have finished) ---"
if [ -d "$ROOT/stems_demucs/global" ] && [ -f "$ROOT/stems_demucs/global/drums.wav" ]; then
"$PY" "$TT/eda_stems.py" "$SPEC"
else
echo "global stems absent — running the section-only EDA"
"$PY" "$TT/eda_stems.py" "$SPEC" --no-global
fi
echo
echo "--- what is on disk now ---"
for v in streaming club; do
d="$ROOT/tracks_v1_$v"
[ -d "$d" ] && echo "$v: $(ls "$d"/*.flac 2>/dev/null | wc -l) tracks"
done
echo
echo "finish_cosmic done $(date -Is)"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment