Skip to content

feat: enable arrangement clip placement playback#46

Merged
britle20 merged 5 commits into
developfrom
feat/41-arrangement-clip-placement
Jun 13, 2026
Merged

feat: enable arrangement clip placement playback#46
britle20 merged 5 commits into
developfrom
feat/41-arrangement-clip-placement

Conversation

@britle20

Copy link
Copy Markdown
Collaborator

Summary

  • Adds serializable arrangement tracks and ClipInstance model helpers for beat-snapped placement, moving, deletion, and playback range calculation.
  • Converts the SONG arrangement shell from static demo clips to real sidebar drag/drop placement, selected instance deletion, movement, and playhead rendering.
  • Expands placed hybrid/audio clips into scheduler events for SONG playback and tracks scheduled sample voices so pause/stop can stop long imported audio sources.
  • Updates docs and PLANS.md for Arrangement clip placement and playback #41 and adds focused unit tests.

Changes

  • Sidebar clip rows are now drag sources for arrangement placement.
  • Arrangement tracks are seeded in app state and placed clip instances are kept as serializable state.
  • SONG transport schedules arrangement instances instead of the selected PAT clip.
  • Imported audio clips are guarded with a clear runtime-cache missing-source error.

Testing

  • npm run typecheck --if-present
  • npm run lint --if-present
  • npm run test --if-present
  • npm run build --if-present
  • npm run dev -- --host 127.0.0.1 --port 5173, served on 5174 because 5173 was occupied, then curl -I http://127.0.0.1:5174/ returned 200

Notes / Limitations

  • SONG playback currently reuses the existing lookahead loop scheduler across the visible arrangement range. A true non-looping linear song transport that stops exactly at arrangement end is deferred.
  • Audio clip instance resize/crop is still deferred because this feature does not add resize handles or duration-aware SampleLoopEvent playback.
  • Imported audio bytes remain session-only until IndexedDB/import persistence is implemented.

Closes #41

@britle20

Copy link
Copy Markdown
Collaborator Author

Follow-up update:

  • Fixed SONG-mode sidebar selection so selecting clips/instruments no longer replaces active arrangement playback with PAT clip events or stops playback just because an audio clip was selected.
  • Added arrangement loop start/end controls snapped to bar boundaries, with visible loop region markers in the timeline.
  • SONG playback now passes the selected arrangement loop range as scheduler loopStartTick/loopEndTick.
  • Added arrangement loop range model helpers/tests and updated docs.

Verification rerun:

  • npm run typecheck --if-present
  • npm run lint --if-present
  • npm run test --if-present
  • npm run build --if-present
  • npm run dev -- --host 127.0.0.1 --port 5173, served on 5174 because 5173 was occupied, curl -I returned 200

@britle20

Copy link
Copy Markdown
Collaborator Author

Follow-up update:

  • Replaced toolbar loop start/end selects with draggable V-shaped loop handles on the arrangement ruler.
  • Removed the pale green full-track loop fill.
  • Kept only thin loop boundary lines in the track area and a green connector line between the ruler handles.
  • Updated UI design docs for the new loop handle interaction.

Verification rerun:

  • npm run typecheck --if-present
  • npm run lint --if-present
  • npm run test --if-present
  • npm run build --if-present
  • npm run dev -- --host 127.0.0.1 --port 5173, served on 5174 because 5173 was occupied, curl -I returned 200

@britle20

Copy link
Copy Markdown
Collaborator Author

Follow-up update:

  • Removed the empty arrangement hint text: "Drag clips from the sidebar into a track."
  • Moved the loop handle V markers and connector line upward so they no longer cover the bar numbers.

Verification rerun:

  • npm run typecheck --if-present
  • npm run lint --if-present
  • npm run test --if-present
  • npm run build --if-present
  • npm run dev -- --host 127.0.0.1 --port 5173, served on 5174 because 5173 was occupied, curl -I returned 200

@britle20

Copy link
Copy Markdown
Collaborator Author

Follow-up update:

  • Removed the Delete selected toolbar button.
  • Arrangement clip instances can now be deleted by right-clicking the clip block, matching the piano roll deletion interaction.
  • Kept Delete/Backspace keyboard deletion on focused clip blocks for accessibility.
  • Updated docs to describe right-click deletion.

Verification rerun:

  • npm run typecheck --if-present
  • npm run lint --if-present
  • npm run test --if-present
  • npm run build --if-present
  • npm run dev -- --host 127.0.0.1 --port 5173, served on 5174 because 5173 was occupied, curl -I returned 200

@britle20 britle20 merged commit 5fa802f into develop Jun 13, 2026
1 check 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