Skip to content

Fix beat loop wrapping for copied clips#10

Merged
lucaromagnoli merged 1 commit into
magda_minimalfrom
fix/beat-loop-wrap-copied-clips
May 5, 2026
Merged

Fix beat loop wrapping for copied clips#10
lucaromagnoli merged 1 commit into
magda_minimalfrom
fix/beat-loop-wrap-copied-clips

Conversation

@lucaromagnoli

Copy link
Copy Markdown
Contributor

Summary

Engine-side counterpart to MAGDA's beat-mode clip copy/paste fixes. Adjusts WaveNode and EditNodeBuilder so that a copied autoTempo+looped clip wraps its source-beat phase correctly instead of rendering silence past the loop boundary.

Test plan

  • CI on Conceptual-Machines/tracktion_engine passes
  • After merge, bump magda-core's submodule pointer and re-run its CI

linearPositionToLoopPosition mapped a beat position to its loop-relative
phase via loopStart + fmod(position, loopLength). That formula only
gives the correct phase when loopStart == 0; if the loop region begins
at a non-zero source beat (the right side of a split, a time-range copy
that began mid-loop, or any clip whose user-set loop start isn't bar 1
of the source) the read position folded outside the loop and the
WaveNode rendered silence past the loop boundary.

Subtract loopStart before the modulo, and handle negative phase
explicitly so positions before the loop start wrap forward rather than
landing at a negative offset.
@lucaromagnoli lucaromagnoli force-pushed the fix/beat-loop-wrap-copied-clips branch from e2d0d75 to dbf2994 Compare May 5, 2026 20:05
@lucaromagnoli lucaromagnoli merged commit fe65263 into magda_minimal May 5, 2026
3 checks passed
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.

1 participant