Repository navigation
feat(editor): conform bar-grid to selected pill's audio onset - #36
Merged
Merged
Conversation
Adds a CONFORM TO PILL button in the SyncTuner pill-mode panel that re-anchors the master `audioStartNudgeS` so beat 0 lands on the audio onset of the currently selected pill's source segment. Mirrors triage's per-chunk Conform: re-aligns FX/cut snap-targets against a single pill when small drift accumulated across many pills (typical for arrangement- mode jobs from triage), or when the global audio-start sits in front of a leading pause in the composite. The button shows the would-be nudge delta and disables when there is no detected onset, no BPM, or the delta would be < 1 ms (idempotent).
1 of 2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
audioStartNudgeSso beat 0 lands on the selected pill's source-segmentaudioStartMs.Why
There's only one bar-timeline in the editor, anchored at the auto-detected first onset of the master audio. With many pills (long-form/arrangement jobs) small additive offsets between FX/cut snap-times and the per-chunk audio onset accumulate, and any leading silence/pause before the first chunk makes "audio-start = first audio in master" a poor anchor for downstream pills. Letting the user re-anchor the bar grid to whichever pill they're currently working on lets them get sample-accurate snap on that pill again, the same way triage's Conform realigns chunk bounds to bar boundaries.
Behavior
CONFORM TO PILL (+59.32 ms).CONFORM TO PILL · NO ONSET),jobMeta.audioStartNudgeS = segment.audioStartMs/1000 - bpm.phase. The Master-Audio panel TOTAL readout reflects the new value; RESET TO ALGO there reverts.Implementation
conformAudioStartToPill(pillId)returning"ok" | "no-pill" | "no-bpm" | "no-audio-start" | "unchanged"— error codes mirror triage'sconformChunk.segmentIndexAtArr(pill.originalArrStartS, arrangementSegments)—originalArrStartSso any user drag on the pill doesn't decouple it from its arrangement-item segment.store.test.tscovering the happy path (delta math), idempotence, and the three error branches.Test plan
vitest run src/editor— 717 passed (the 2 unrelated WebGL/WebGPU readback browser perf-bench failures are pre-existing on this hardware).tsc --noEmitclean (only the pre-existing@webgpu/typesresolution warning).audioStartMs→ button disabled with· NO ONSETlabel.Out of scope
🤖 Generated with Claude Code