Skip to content

feat(core): name every preset node, and add a multi-band EQ over existing filters - #3178

Merged
vanceingalls merged 596 commits into
mainfrom
wa-20a2-named-jobs-eq
Aug 13, 2026
Merged

feat(core): name every preset node, and add a multi-band EQ over existing filters#3178
vanceingalls merged 596 commits into
mainfrom
wa-20a2-named-jobs-eq

Conversation

@vanceingalls

Copy link
Copy Markdown
Collaborator

Every preset node is named for the job it does"Remove Rumble", not highpass. A chain that cuts mud and then lifts clarity must not show the same name twice.

INVARIANT: any new HfAudioFxNode field must be added to BOTH parseAudioFxChain AND serializeAudioFxChain.

Not hypothetical — the first commit added fromPreset to 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

@miga-heygen miga-heygen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

vanceingalls and others added 24 commits August 13, 2026 01:33
* 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
Base automatically changed from wa-20a1-preset-catalogue to main August 13, 2026 13:33
@github-actions

Copy link
Copy Markdown

Fallow audit report

Found 4 findings.

Duplication (2)
Severity Rule Location Description
minor fallow/code-duplication packages/core/src/audioFxEq.test.ts:33 Code clone group 1 (7 lines, 2 instances)
minor fallow/code-duplication packages/core/src/audioFxPresets.test.ts:208 Code clone group 1 (7 lines, 2 instances)
Health (2)
Severity Rule Location Description
major fallow/high-crap-score packages/core/src/audioFx.ts:874 'nodes' has CRAP score 63.6 (threshold: 30.0, cyclomatic 15)
critical fallow/high-crap-score packages/studio/src/components/editor/propertyPanelFxSection.tsx:269 'FxCarveModule' has CRAP score 148.4 (threshold: 30.0, cyclomatic 24)

Generated by fallow.

@vanceingalls
vanceingalls merged commit 9f67620 into main Aug 13, 2026
55 of 57 checks passed
@vanceingalls
vanceingalls deleted the wa-20a2-named-jobs-eq branch August 13, 2026 13:57
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.

2 participants