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.#5 Lookahead Scheduler -> `docs/features/03-lookahead-scheduler.md` (PR #14 in review)
Copy file name to clipboardExpand all lines: docs/audio-engine.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,6 +90,8 @@ Events at the loop start should play when the loop begins. Events at the loop en
90
90
91
91
Loop stop clears the scheduler timer and prevents future windows from being scheduled. Events already submitted to Web Audio inside the current schedule-ahead window may still play briefly; keep `scheduleAheadTime` short enough that this limitation remains acceptable for interactive editing.
92
92
93
+
When the user edits a drum pattern during playback, the UI may update the scheduler's event list without restarting transport. Newly scheduled windows should use the latest serializable drum events. Events already submitted to Web Audio inside the current schedule-ahead window may still reflect the previous pattern because Web Audio scheduled source nodes cannot be unscheduled after `start(when)`.
94
+
93
95
## UI Playhead Separation
94
96
95
97
UI cursor and playhead animation may use `requestAnimationFrame` and read transport position from the audio engine. Visual playhead timing can be approximate. Exact sound timing must come from scheduled Web Audio events.
Copy file name to clipboardExpand all lines: docs/data-model.md
+45Lines changed: 45 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,44 @@ Early clips may contain both drum events and note events. This keeps the M1 edit
28
28
29
29
Later, the model can evolve toward separate drum, MIDI, and audio clip types if arrangement and editing workflows need stronger separation.
30
30
31
+
## Bundled Drum Sample Naming and Display
32
+
33
+
Bundled drum sample files live under `public/samples/drums/`.
34
+
35
+
Use descriptive `.wav` file names with words separated by underscores, for example:
36
+
37
+
```text
38
+
Fred_Kick_1.wav
39
+
Fred_Closed_Hi-Hat.wav
40
+
```
41
+
42
+
The app derives sample metadata from the file name:
43
+
44
+
- Sample IDs are the file stem lowercased with underscores replaced by hyphens.
45
+
- Display names remove `.wav`, replace underscores with spaces, and uppercase the result.
46
+
47
+
Examples:
48
+
49
+
-`Fred_Kick_1.wav` -> sample ID `fred-kick-1`, display name `FRED KICK 1`.
50
+
-`Fred_Closed_Hi-Hat.wav` -> sample ID `fred-closed-hi-hat`, display name `FRED CLOSED HI-HAT`.
51
+
52
+
## Initial Drum Clip Implementation
53
+
54
+
The initial drum step sequencer stores lane settings and drum hits in the selected hybrid clip. A 16-step grid maps step indices to ticks with `stepIndex * 120`.
55
+
56
+
The clip stores `drumLanes` as an ordered array. That array controls both visual lane order and the current sample assigned to each lane. Reordering lanes or changing a lane's sample must update serializable clip state, not runtime-only audio state.
57
+
58
+
Initial drum lanes map to bundled sample IDs:
59
+
60
+
-`kick` -> `fred-kick-1`
61
+
-`snare` -> `fred-snare-1`
62
+
-`closedHat` -> `fred-closed-hi-hat`
63
+
-`openHat` -> `fred-open-hi-hat`
64
+
65
+
Drum event IDs are deterministic within a clip using the clip ID, lane ID, and start tick. Runtime playback converts these serializable events into audio engine sample loop events; the project model itself does not store `AudioBuffer` or other Web Audio objects.
66
+
67
+
When a lane sample changes, existing `DrumEvent` objects for that lane should be updated to the new `sampleId` so playback and project export reflect the visible lane setting.
68
+
31
69
## Illustrative Types
32
70
33
71
These snippets show model intent. Implementation may refine names and fields, but changes to model semantics must update this document.
Copy file name to clipboardExpand all lines: docs/ui-design.md
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -114,6 +114,22 @@ Inline styles are acceptable for computed editor geometry, including:
114
114
115
115
Keep static appearance in CSS Modules. Keep dynamic numeric layout derived from ticks, pitch, and grid dimensions.
116
116
117
+
## Sample Display Names
118
+
119
+
When displaying bundled drum sample names in the UI, derive the label from the `.wav` file name:
120
+
121
+
- Remove the `.wav` extension.
122
+
- Replace underscores (`_`) with spaces.
123
+
- Convert the result to uppercase.
124
+
125
+
Example: `Fred_Kick_1.wav` displays as `FRED KICK 1`.
126
+
127
+
## Drum Lane Editing
128
+
129
+
Drum lane names can act as sample selectors. Clicking a lane name may open a compact scrollable list of bundled drum samples. Render this menu as a popover above clipping editor containers when needed so it is not cut off by panel or workspace overflow. Selecting a sample should update the lane's visible label, the lane's `sampleId`, and existing drum events for that lane in serializable clip state.
130
+
131
+
Drum lanes may be reordered vertically with drag and drop. The visual order should come from the selected clip's ordered `drumLanes` array rather than a hard-coded component order.
132
+
117
133
## UI Reference Policy
118
134
119
135
If a design prototype uses Tailwind, inline styles, or CDN assets, treat it as visual reference only. Convert the design into semantic React components, CSS Modules, and shared CSS variables.
0 commit comments