Repository navigation
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,6 +67,32 @@ export function nextLoopWrapMasterT( | |
| }; | ||
| } | ||
|
|
||
| /** Build a loop region of `seconds` length centered on the playhead. | ||
| * | ||
| * Works purely in arr-time. The caller MUST pass the AUTHORITATIVE arr-time | ||
| * playhead (`playback.timelineT`), NOT `masterToArr(currentTime)` — the | ||
| * latter scans for the first segment whose master range contains the | ||
| * playhead and snaps onto the FIRST occurrence when a chunk is repeated in | ||
| * the arrangement, so the loop would land on the wrong occurrence (the | ||
| * same first-match trap the walker avoids by tracking `currentSegmentIdx`). | ||
| * Clamps the window to `[0, totalArrS]`, preserving its full length where | ||
| * possible. Callers still pass the result through `setLoop`, which narrows | ||
| * it to the master-trim window. */ | ||
| export function loopAroundPlayhead( | ||
| playheadArrT: number, | ||
| seconds: number, | ||
| totalArrS: number, | ||
| ): LoopRegion { | ||
| const half = seconds / 2; | ||
| let start = Math.max(0, playheadArrT - half); | ||
| let end = start + seconds; | ||
| if (end > totalArrS) { | ||
| end = totalArrS; | ||
| start = Math.max(0, end - seconds); | ||
| } | ||
| return { start, end }; | ||
| } | ||
|
|
||
| /** Clamp the loop to the playable arr-time window: the intersection of | ||
| * the segments' totalArrDuration and the master-trim's projection into | ||
| * arr-time. Master-trim universally narrows the loop in both single-take | ||
|
|
||
fix(editor): correct long-form loop placement (arr-time anchoring) #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
fix(editor): correct long-form loop placement (arr-time anchoring) #48
Changes from all commits
44b754bFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.