feat(studio): the Tone module — a multi-band EQ on faders - #3179
Conversation
dd80e8d to
7ddc505
Compare
10896de to
2e022bc
Compare
miga-heygen
left a comment
There was a problem hiding this comment.
Review: feat(studio): the Tone module — a multi-band EQ on faders — #3179
Verdict: LGTM
Chain-authoritative invariant holds by design. Bands are never cached — readAudioEqBands(chain, eqId) is called inline in JSX, recomputed every render. The only local state is openEq (UI-only) and the per-Fader local/dragging pair, which correctly resets to band.gain via useEffect when not dragging. This is the right pattern: the chain is the source of truth, the fader is a view of it.
Fader UX is clean. Center-detent math maps gain=0 → 50%, positive → top/boost, negative → bottom/cut. Fill bar tracks value (not band.gain) so dragging across zero flips the fill direction live. The <input type="range"> rotated -90° is smart — preserves keyboard control, focus management, and platform pointer handling that a div-with-pointer-events would reimplement badly.
Drag/commit split is correct. move() sets dragging=true, updates local state, calls onPreview. settle() sets dragging=false, calls onCommit(local). The if (!dragging) return guard in settle() prevents double-commits from pointerup + blur racing.
Integration with #3178's EQ API uses all the right functions with correct signatures. The handBuilt filter excludes fromEq nodes so bands don't appear twice in the rack. removeEq correctly iterates chain.nodes.filter(n => n.fromEq === eqId) to clean up per-node automation before removing.
Tests exercise real chain manipulation (not mocked): addAudioEq creates the right node types, band nodes are hidden from the rack list, and the preview-during-drag / commit-on-release split is verified.
No blocking issues.
Review by Miga
🤖 Generated with Claude Code
2e022bc to
23886ef
Compare
7ddc505 to
bff8f50
Compare
23886ef to
ca98c28
Compare
bff8f50 to
19cbbeb
Compare
ca98c28 to
73f6529
Compare
19cbbeb to
7696263
Compare
73f6529 to
30693e2
Compare
7696263 to
072040b
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
Faders rather than the rack's horizontal sliders, because a row of them around a centre detent is what an equaliser looks like to everybody who has met one. Recognising the control is most of the value.
The chain is authoritative: bands are read back out of the tagged nodes on every render, so there is no cached list to fall out of sync.
🤖 Generated with Claude Code