You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: PLANS.md
+2-3Lines changed: 2 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,9 +29,8 @@ M1 should include:
29
29
30
30
Use this section as the current execution order for agent work. Feature document numbering describes the planned product sequence, but actual issue order may change as dependencies, review feedback, or implementation risks become clearer.
31
31
32
-
1.#39 WAV file import as audio clip -> `docs/features/15-wav-file-import-as-audio-clip.md`
33
-
2.#41 Arrangement clip placement and playback -> `docs/features/16-arrangement-clip-placement-and-playback.md`
34
-
3.#43 Mixer audio routing and track controls -> `docs/features/17-mixer-audio-routing-and-track-controls.md`
32
+
1.#41 Arrangement clip placement and playback -> `docs/features/16-arrangement-clip-placement-and-playback.md`
33
+
2.#43 Mixer audio routing and track controls -> `docs/features/17-mixer-audio-routing-and-track-controls.md`
Copy file name to clipboardExpand all lines: docs/audio-engine.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,6 +67,10 @@ Arrangement playback should:
67
67
68
68
The first arrangement playback implementation may play linearly from tick 0 through the end of the last placed clip instance, then stop. Arrangement loop regions can be added later.
69
69
70
+
The current first pass reuses the existing lookahead loop scheduler for `SONG` mode by setting a loop range that covers the visible arrangement. This keeps scheduling independent from React and enables pause/resume with the existing transport API, but it is not yet a true one-shot linear song transport. A later transport task should add non-looping arrangement playback that stops at the arrangement end.
71
+
72
+
The arrangement view may set loop start and loop end at bar boundaries. `SONG` playback should pass those ticks as the scheduler `loopStartTick` and `loopEndTick`. Selecting clips or instruments in the sidebar while `SONG` mode is playing must not replace the active arrangement scheduler with selected-clip `PAT` events.
73
+
70
74
Imported audio clips should play at original speed unless a later time-stretching feature explicitly changes that behavior. If an audio clip instance is shorter than the source buffer, playback should be cropped. If the instance is longer than the source buffer, playback may end naturally and leave silence. If runtime file data is missing after refresh, the engine should report a clear missing-source error rather than silently failing.
71
75
72
76
Arrangement playback still uses the lookahead scheduler. UI drag state, arrangement DOM geometry, visual playheads, decoded buffers, and active source nodes remain runtime-only.
The first arrangement placement feature should create, move, select, and delete `ClipInstance` objects without mutating the source `Clip`. Deleting a placed clip from the arrangement removes only that instance. It does not delete the sidebar clip.
175
186
187
+
The first implementation keeps arrangement tracks, clip instances, and loop range in app-level state. The data is still serializable and should map directly into future `Project.tracks`, `Project.clipInstances`, and arrangement transport fields when export/import is implemented.
188
+
176
189
Default instance lengths:
177
190
178
191
- Hybrid clip: use the source clip's `lengthTicks`, initially 1920 ticks for a 1-bar clip.
Copy file name to clipboardExpand all lines: docs/features/16-arrangement-clip-placement-and-playback.md
+10-2Lines changed: 10 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
# Feature: 16 Arrangement Clip Placement and Playback
2
2
3
3
## Status
4
-
Planned
4
+
In Review
5
5
6
6
## Goal
7
7
@@ -33,6 +33,7 @@ Included:
33
33
- Select and delete placed clip instances.
34
34
- Keep the existing arrangement track list and timeline layout aligned.
35
35
- Add a visual arrangement playhead in `SONG` mode.
36
+
- Let users set arrangement loop start and loop end on bar boundaries.
36
37
- Make transport play, pause, resume, and stop operate on arrangement playback when `SONG` mode is active.
37
38
- Schedule placed hybrid clips by expanding their drum and note events relative to each `ClipInstance.startTick`.
38
39
- Schedule placed audio clips when imported audio runtime data is available.
@@ -99,7 +100,7 @@ Use the existing `SONG` arrangement layout:
99
100
- Placed clips render as timeline blocks.
100
101
- Dragging a placed clip moves it to another snapped start time or track.
101
102
- Selecting a placed clip shows a clear selected state.
102
-
-Deleting a placed clip instance removes only that arrangement placement, not the source clip from the sidebar.
103
+
-Right-clicking a placed clip instance deletes only that arrangement placement, not the source clip from the sidebar.
103
104
104
105
Snap should start simple. Prefer beat-level snapping, using 480 ticks, unless the existing arrangement snap control already supports a narrower value. Later features may add user-selectable snap resolution.
105
106
@@ -109,6 +110,8 @@ If browser drag-and-drop is awkward for track timeline geometry, pointer-based d
109
110
110
111
`SONG` playback should schedule arrangement events, not selected-clip loop events.
111
112
113
+
Selecting a sidebar clip or instrument while `SONG` mode is playing should only change UI selection. It must not replace active arrangement playback with selected `PAT` clip events or stop playback just because an imported audio clip was selected.
114
+
112
115
The audio engine or feature orchestration should expand clip instances into runtime scheduler events:
@@ -117,6 +120,10 @@ The audio engine or feature orchestration should expand clip instances into runt
117
120
118
121
The arrangement transport may initially play linearly from tick 0 through the end of the last clip instance and then stop. Arrangement loop ranges can be added later.
119
122
123
+
The first implementation may reuse the existing lookahead loop scheduler over the visible arrangement range while the arrangement-specific one-shot/linear transport matures. If so, document the limitation in the PR and keep the arrangement event expansion independent from React.
124
+
125
+
When an arrangement loop range is set, `SONG` playback should use that range for `loopStartTick` and `loopEndTick`.
126
+
120
127
Events already scheduled inside the lookahead window may still play briefly after edits, pause, or stop. Keep the scheduling window short enough for interactive editing.
121
128
122
129
## Done when
@@ -130,6 +137,7 @@ Events already scheduled inside the lookahead window may still play briefly afte
130
137
-`SONG` transport playback schedules placed clip instances.
131
138
- Pause, resume, and stop work in `SONG` mode.
132
139
- A visual arrangement playhead follows playback and resets or hides appropriately when stopped.
140
+
- Loop start and loop end can be set on bar boundaries and `SONG` playback loops that range.
133
141
- Hybrid clip drum and note events play at their arrangement positions.
134
142
- Audio clip instances play when runtime imported audio data is available.
135
143
- Missing imported audio runtime data is reported clearly instead of silently failing.
Copy file name to clipboardExpand all lines: docs/ui-design.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -113,6 +113,8 @@ Track headers, timeline lanes, and clip blocks must align exactly. Use shared ge
113
113
114
114
Do not introduce real arrangement data, persisted clip instances, arrangement playback, or drag-and-drop editing in the first arrangement UI shell unless a feature spec explicitly expands the scope.
115
115
116
+
The arrangement placement feature expands this shell into an editable first pass. Static demo clip blocks should be removed once real `ClipInstance` state is available.
117
+
116
118
## Arrangement Clip Placement
117
119
118
120
The next arrangement step should make the `SONG` view editable and playable.
@@ -122,8 +124,10 @@ The next arrangement step should make the `SONG` view editable and playable.
122
124
- Dropping a clip creates a visible clip block backed by a serializable `ClipInstance`.
123
125
- Moving a clip block updates `startTick` and `trackId`, not stored pixel positions.
124
126
- Selecting a clip block should show a clear selected state.
125
-
-Deleting a selected clip block removes only the arrangement instance, not the source clip in the sidebar.
127
+
-Right-clicking a clip block deletes only that arrangement instance, not the source clip in the sidebar.
126
128
- Static demo clip blocks should be removed or replaced with seeded serializable state.
129
+
- The arrangement ruler may expose draggable loop start and loop end handles snapped to bar boundaries.
130
+
- The timeline should show loop start/end boundary lines. Avoid filling the full loop range across tracks; a small ruler connector between the loop handles is enough.
127
131
128
132
Use shared arrangement geometry constants for row height, ruler height, bar width, beat width, timeline width, and track header width. Inline styles are acceptable for dynamic clip geometry such as `left`, `top`, `width`, and transform values.
0 commit comments