Repository navigation
feat(triage): slice a chunk into fixed N-bar intervals - #53
Merged
Merged
Conversation
…imation Add a one-shot "SLICE TO BARS" action to the chunk inspector: pick an interval (1–X bars) and cut the focused chunk into that many bar-length pieces in a single click, instead of N manual splits. Useful for a long take that's really many repeated phrases. - Cuts land on downbeats of the chunk's own bar grid; the remainder stays as a shorter final piece (14 bars @ 4 -> 4+4+4+2). The first piece keeps the original id so persistent refs survive. - Reuse the bar-count LCD: extract MinBarsFilter out of DetectionPanel into a shared BarCountLcd component (now the single source of truth for the LCD palette), used by both the MIN filter and the slice ctrl. - Arrangement-safe: sliceFocusedGuarded confirms when the chunk is in use, then applySliceToArrangement expands each occurrence into the pieces back-to-back (N-way generalisation of split "both"). - "Downbeat guillotine" reveal in the timeline (framer-motion): a phosphor blade drops on each cut staggered left->right, then each new piece deals in from its seam with a one-shot flash. Respects prefers-reduced-motion. TDD: 24 new unit tests for sliceChunkIntoBars + applySliceToArrangement; full suite green, typecheck clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
Adds a one-shot SLICE TO BARS action to the Triage chunk inspector: pick an interval (1–X bars) on the bar-count LCD and cut the focused chunk into that many bar-length pieces in a single click — instead of N manual splits. Built for a long take that's really many repeated phrases.
Why
Manually splitting a 14-bar take into 4-bar phrases meant clicking Split repeatedly at each downbeat. This carves the whole chunk on the bar grid in one action.
How it works
audioStartMsanchor). The remainder stays as a shorter final piece (14 bars @ interval 4 →4+4+4+2). The first piece keeps the original chunk id so persistent references survive.MinBarsFilterout ofDetectionPanelinto a sharedBarCountLcdcomponent (now the single source of truth for the LCD palette), used by both the existing MIN filter and the new slice control.sliceFocusedGuardedconfirms when the chunk is in the arrangement, thenapplySliceToArrangementexpands each occurrence into the pieces back-to-back (the N-way generalisation of split's"both"branch).prefers-reduced-motion.Files
BarCountLcd.tsx(new) — shared LCD widget extracted fromDetectionPaneltriage-store.ts—sliceIntervalBarsstate +sliceChunkIntoBarsaction + transientsliceRevealmarkertriage-arrangement-ops.ts—applySliceToArrangementtriage-guarded-actions.ts—sliceFocusedGuardedChunkInspector.tsx— the SLICE sectionTriageTimeline.tsx— the reveal animationTesting
sliceChunkIntoBars+applySliceToArrangement(exact-multiple, remainder, sub-interval, no-BPM, grid alignment, metadata inheritance, arrangement expansion).Reviewer note: the animation + inspector layout need a real loaded session to see (no saved jobs / media upload couldn't be automated here). To test: open a session → Triage, select a chunk with a BPM, set BARS, hit Cut into Nb.
🤖 Generated with Claude Code