feat(core): name every preset node, and add a multi-band EQ over existing filters - #3178
Conversation
68263fa to
5fb2c91
Compare
dd80e8d to
7ddc505
Compare
miga-heygen
left a comment
There was a problem hiding this comment.
Review: feat(core): name every preset node, and add a multi-band EQ — #3178
Verdict: LGTM
This is the fix half of the #3177+#3178 load-bearing pair, and it delivers. All three new HfAudioFxNode fields round-trip correctly:
- Parse side (defensive):
typeof node.X === "string" && node.X— guards against non-string JSON values, drops empty strings. - Serialize side (trusted):
node.X ? { X: node.X } : {}— the typed interface guarantees string-or-undefined, so truthiness is sufficient.
Both sides agree on the empty-string boundary (both treat it as absent). The pattern mirrors the existing fromCarve handling exactly.
The upgraded round-trip test is the real deliverable. The old test compared only n.type; the new one compares { type, id, fromPreset, label }. The PR body's comment — "Comparing only types is what let fromPreset be silently dropped by the parser" — is exactly right, and the new test is the regression gate.
Named-job labels flow through node.label ?? def.label in the UI — no hardcoded label map. The "names every node for the job it is doing" test enforces this across the entire preset catalog, with a thoughtful exemption for stacked pairs (consecutive identical nodes with matching params = one stage built from two biquads, like steep()).
EQ composite is well-designed. fromEq tagging follows the fromCarve pattern. Per-band ids are minted with the chain visible, so automation lanes address the correct biquad. readAudioEqBands reads from chain nodes (source of truth), not a cached list. The round-trip test verifies audioEqIds, band names, and gain values all survive serialization.
One observation (non-blocking): setAudioEqBandGain identifies bands by node.label === bandName. If custom bands with duplicate names were passed to addAudioEq, the fader would move both simultaneously. Not exploitable today (preset band names are unique), but a doc note making this explicit would be good hygiene.
No blocking issues.
Review by Miga
🤖 Generated with Claude Code
7ddc505 to
bff8f50
Compare
5fb2c91 to
def70d3
Compare
bff8f50 to
19cbbeb
Compare
def70d3 to
df2cc3e
Compare
19cbbeb to
7696263
Compare
df2cc3e to
6a84ad0
Compare
7696263 to
072040b
Compare
6a84ad0 to
804bc1e
Compare
* feat(core): carve against every voice over a bed, always dynamically A bed usually runs under a whole sequence — a narrator, an interview answer, a second presenter — and carving against one of them left the others fighting it. `source` becomes `sources`, and `mixCarveSources` sums every voice onto the BED's clock before anything is measured. That is what keeps one analysis sufficient: the chain is fixed, so there is no per-voice filter to switch between, and bands drawn from all the speech there is with envelopes that rise wherever any of it happens answer the actual question — where and when is speech masking this bed. Summed rather than averaged: two people talking at once mask more than either alone. Audio before the bed starts is dropped rather than folded in at zero, since it plays over nothing and shifting it would put a cut where there is no voice. `dynamic` is gone. A fixed depth thins the bed through every pause, and once both have been heard there is no reason to want it, so every carve follows the speech. Two helpers the panel and the headless script now share instead of each carrying a copy — two definitions of "what does this name suggest" drift, and then the two disagree about which track is the voice: - `classifyAudioName` reads a track's kind from its id and filename together. `unknown` is deliberately common: treating an unrecognised name as "not a voice" would hide the one track somebody needs to pick. - `clipsOverlap` keeps out a voice that never plays while the bed does. An unwritten duration counts as unbounded, not zero — refusing a clip whose length the composition leaves to the media would drop the commonest case there is. Files written before this still load: a single `source` reads as a one-voice list, a stored `dynamic` is ignored, and an absent attribute means the defaults whole. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix(core): stop \b from missing underscore-separated names, guard clipsOverlap's negative duration \b treats `_` as a word character, so \bbed\b never matched bed_01, music_bed_loop, or theme_song, and \bvo\b/\bvox\b/\btts\b had the same gap — an underscore-separated bed classified as "unknown" and could end up offered as its own carve source. Replaced the short hints with a boundary that actually excludes letters and digits on both sides. clipsOverlap computed end = start + duration without guarding sign, so a negative duration put end before start — an interval that does not describe anything, and one specific case showed it silently dropping a real overlap (a shorter, earlier broken end rejected a clip that genuinely contained the point). Duration clamps to zero instead: a clip cannot un-play time, and a zero-length clip at its start is the sane reading of "duration nobody wrote down as positive." Review by Miga (PR #3212). --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
#3212 (accidentally squash-merged into this branch instead of main) changed HfCarveSettings from a single `source` + `dynamic` toggle to a `sources` list with dynamic mode removed outright — the multi-voice UI consumer that goes with that shape lands in the very next PR, so this branch was left with a type that no longer matched its own code. Minimal port, not the multi-voice redesign that PR does properly: the "Listen to" picker and analyse() treat sources[0] as the one voice this UI still understands, and every dynamic-mode branch (the automated envelope lanes, the toggle, the checkbox) is gone along with the field — a carve is now always the static value the analysis computes, matching what the type change made permanent. Test suite trimmed the same way: the automation-lane and toggle tests covered behavior that no longer exists.
# Conflicts: # packages/studio/src/components/editor/propertyPanelAudioFxGroup.test.tsx # packages/studio/src/components/editor/propertyPanelAudioFxGroup.tsx # packages/studio/src/components/editor/propertyPanelFxSection.tsx
# Conflicts: # packages/studio/src/components/editor/propertyPanelAudioFxGroup.test.tsx # packages/studio/src/components/editor/propertyPanelAudioFxGroup.tsx # packages/studio/src/components/editor/propertyPanelFxSection.tsx # skills-manifest.json # skills/hyperframes-audio/SKILL.md # skills/hyperframes-audio/references/attributes.md # skills/hyperframes-audio/scripts/carve.mjs
Fallow audit reportFound 4 findings. Duplication (2)
Health (2)
Generated by fallow. |
Every preset node is named for the job it does —
"Remove Rumble", nothighpass. A chain that cuts mud and then lifts clarity must not show the same name twice.Not hypothetical — the first commit added
fromPresetto the type and the writer but not the parser, so the tag was silently dropped on every reload and a preset could no longer find its own nodes. The round-trip test passed the whole time because it compared only node types.Tone (EQ) is built as a composite over existing filters rather than a new effect type: users know what an EQ is, they don't know they want five peaking filters — and the registry's params are flat key/value and cannot express a band array.
🤖 Generated with Claude Code