Skip to content

Commit 6fed252

Browse files
committed
Repair MIDI Studio V2 instrument grouping, MIDI import, and fullscreen timeline layout - PR_26146_027-midi-studio-v2-instrument-import-and-layout-repair
1 parent c096ea6 commit 6fed252

13 files changed

Lines changed: 656 additions & 142 deletions
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# PR_26146_027 MIDI Studio V2 Instrument Import And Layout Repair Validation
2+
3+
## Status
4+
5+
PASS
6+
7+
## Scope Completed
8+
9+
- Added per-row Type group and Instrument dropdowns in the visible timeline row header.
10+
- Type changes repopulate Instrument options and update the row label to the selected instrument.
11+
- Removed the Advanced Raw Song Sheet UI and raw parser button from the primary workflow.
12+
- Moved MIDI Import into Selected Song Details and removed MIDI Import and Export from the main tab row.
13+
- Added a local MIDI file picker for `.mid` and `.midi` files.
14+
- Avoided default hard-coded MIDI source fetches during normal UAT; missing MIDI source paths only appear when inspecting a selected song that declares one.
15+
- Compacted instrument row layout and left volume/pan controls behind icon toggles.
16+
- Added `+` row creation from the Instrument header and delete actions per timeline row.
17+
- Add/delete row actions update the selected song arrangement, playback source data, status, and diagnostics.
18+
- Fullscreen keeps transport and left timeline context while giving the center timeline more horizontal width.
19+
- Preserved manifest import, multiple songs, editable Selected Song Details, consolidated Song Sheet, timeline playback, playhead, Stop All Audio, and export WARN behavior.
20+
21+
## Validation Commands
22+
23+
- PASS: `node --check tools/midi-studio-v2/js/controls/InstrumentGridControl.js`
24+
- PASS: `node --check tools/midi-studio-v2/js/MidiStudioV2App.js`
25+
- PASS: `node --check tests/playwright/tools/MidiStudioV2.spec.mjs`
26+
- PASS: `node --check tools/midi-studio-v2/js/services/MidiSourceInspectionService.js`
27+
- PASS: `node --check src/engine/audio/PreviewInstrumentPacks.js`
28+
- PASS: `node --check src/engine/audio/PreviewSynthEngine.js`
29+
- PASS: `node --check tools/midi-studio-v2/js/bootstrap.js`
30+
- PASS: `node --check tools/midi-studio-v2/js/controls/MidiSourceDetailsControl.js`
31+
- PASS: `node --check tools/midi-studio-v2/js/controls/SongSheetControl.js`
32+
- PASS: `rg --pcre2 -n '<style|on(click|change|input|submit)=|<script(?![^>]*src)' tools/midi-studio-v2/index.html; if ($LASTEXITCODE -eq 1) { exit 0 }`
33+
- PASS: `npx playwright test tests/playwright/tools/MidiStudioV2.spec.mjs -g "imports UAT manifest|imports a local MIDI source|removes the Advanced Raw Song Sheet|keeps MIDI source inspection|expands and restores" --reporter=list --workers=1 --timeout=60000`
34+
- PASS: `npx playwright test tests/playwright/tools/MidiStudioV2.spec.mjs -g "roadmap exists|applies Preview Synth instruments|clears status content" --reporter=list --workers=1 --timeout=60000`
35+
- PASS: `git diff --check`
36+
37+
## Playwright Proof Points
38+
39+
- UAT manifest JSON imports through Import JSON Manifest.
40+
- Multiple UAT songs are listed and selectable.
41+
- Frog Hop and Coal Mine Descent fixture songs still load into the visible timeline.
42+
- Main UAT song populates visible note cells and playable Preview Synth data.
43+
- Type dropdown exists per row and Instrument options update when Type changes.
44+
- Row label follows the selected instrument.
45+
- Volume and pan icon controls reveal sliders.
46+
- Advanced Raw Song Sheet is absent.
47+
- MIDI Import appears under Selected Song Details.
48+
- Export tab and MIDI Import tab are absent from the main tabs.
49+
- MIDI file picker accepts `.mid,.midi`.
50+
- Local MIDI file import creates a selected song without default HTTP 404 noise.
51+
- Instrument rows are compact in their collapsed state.
52+
- `+` adds a timeline instrument row and delete removes it.
53+
- Add/delete row changes update selected-song arrangement playback data.
54+
- Fullscreen preserves transport and side context while expanding the center timeline.
55+
- Play starts audible preview state and Stop All Audio clears playback.
56+
57+
## Coverage
58+
59+
- `docs/dev/reports/playwright_v8_coverage_report.txt` was refreshed by the targeted Playwright runs.
60+
- `docs/dev/reports/coverage_changed_js_guardrail.txt` was refreshed.
61+
- Advisory warning remains for `tools/midi-studio-v2/js/MidiStudioV2App.js` function coverage below 50%; all reported lines executed in the targeted browser run.
62+
63+
## Explicit Non-Runs
64+
65+
- Full samples smoke was not run per request.
66+
- Sample JSON was not modified.

docs/dev/roadmaps/MIDI_STUDIO_V2_ROADMAP.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
- [x] Real UAT manifest fixture includes multiple MIDI Studio songs.
88
- [x] Playable upbeat public-domain/traditional-style test song arrangement includes Lead, Bass, Chords/Pad, and Drums.
99
- [x] Studio tab shows a visible track/timeline editor without opening accordions.
10-
- [x] Tabs organize Studio, Song Setup, Instruments, Auto-Create Parts, MIDI Import, Export, and Diagnostics.
10+
- [x] Tabs organize Studio, Song Setup, Instruments, Auto-Create Parts, and Diagnostics; MIDI Import lives under Selected Song Details and export actions live in the action bar.
1111
- [.] Editable note/timeline grid remains the primary music studio editing surface.
12-
- [ ] Track volume, pan, mute, and solo controls.
12+
- [x] Track volume, pan, mute, and solo controls live on instrument timeline rows.
1313
- [.] Song setup fields for tempo, key, style, intro, and loop.
1414
- [ ] MIDI import conversion to editable tracks.
1515
- [ ] Rendered WAV/MP3/OGG export.

src/engine/audio/PreviewInstrumentPacks.js

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,50 @@ export const PREVIEW_INSTRUMENT_PACKS = [
33
id: "retro-square-lead",
44
label: "Retro Square Lead",
55
synthRole: "lead",
6+
typeGroup: "Synth",
67
volume: 0.075,
78
waveform: "square"
89
},
910
{
1011
id: "retro-pulse-lead",
1112
label: "Retro Pulse Lead",
1213
synthRole: "lead",
14+
typeGroup: "Synth",
1315
volume: 0.07,
1416
waveform: "square"
1517
},
1618
{
1719
id: "synth-bass",
1820
label: "Synth Bass",
1921
synthRole: "bass",
22+
typeGroup: "Bass",
2023
transposeSemitones: -12,
2124
volume: 0.095,
2225
waveform: "triangle"
2326
},
27+
{
28+
approximationWarning: "Keyboard preview is an approximate electric-piano style synth patch.",
29+
id: "preview-electric-piano",
30+
label: "Preview Electric Piano",
31+
synthRole: "lead",
32+
typeGroup: "Keyboard",
33+
volume: 0.065,
34+
waveform: "sine"
35+
},
2436
{
2537
id: "warm-pad",
2638
label: "Warm Pad",
2739
durationScale: 1.3,
2840
synthRole: "pad",
41+
typeGroup: "Keyboard",
2942
volume: 0.045,
3043
waveform: "sine"
3144
},
3245
{
3346
id: "basic-drums",
3447
label: "Basic Drums",
3548
synthRole: "percussion",
49+
typeGroup: "Percussion",
3650
volume: 0.16,
3751
waveform: "noise"
3852
},
@@ -42,8 +56,46 @@ export const PREVIEW_INSTRUMENT_PACKS = [
4256
durationScale: 1.55,
4357
synthRole: "pad",
4458
transposeSemitones: 12,
59+
typeGroup: "FX",
4560
volume: 0.035,
4661
waveform: "sine"
62+
},
63+
{
64+
approximationWarning: "String preview is an approximate synth pad, not a sampled string section.",
65+
durationScale: 1.45,
66+
id: "preview-string-ensemble",
67+
label: "Preview String Ensemble",
68+
synthRole: "pad",
69+
typeGroup: "Strings",
70+
volume: 0.04,
71+
waveform: "sine"
72+
},
73+
{
74+
approximationWarning: "Brass preview is an approximate synth brass patch.",
75+
id: "preview-brass-stab",
76+
label: "Preview Brass Stab",
77+
synthRole: "lead",
78+
typeGroup: "Brass",
79+
volume: 0.07,
80+
waveform: "sawtooth"
81+
},
82+
{
83+
approximationWarning: "Woodwind preview is an approximate breathy synth lead.",
84+
id: "preview-woodwind",
85+
label: "Preview Woodwind",
86+
synthRole: "lead",
87+
typeGroup: "Woodwind",
88+
volume: 0.06,
89+
waveform: "triangle"
90+
},
91+
{
92+
approximationWarning: "Guitar preview is an approximate plucked synth tone.",
93+
id: "preview-clean-guitar",
94+
label: "Preview Clean Guitar",
95+
synthRole: "lead",
96+
typeGroup: "Guitar",
97+
volume: 0.06,
98+
waveform: "triangle"
4799
}
48100
];
49101

src/engine/audio/PreviewSynthEngine.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,13 @@ export class PreviewSynthEngine {
173173
warningKeys.add(key);
174174
}
175175
}
176+
if (instrument.approximationWarning) {
177+
const key = `approximation:${instrument.id}`;
178+
if (!warningKeys.has(key)) {
179+
warnings.push(instrument.approximationWarning);
180+
warningKeys.add(key);
181+
}
182+
}
176183
if (this.canScheduleEvent(event, instrument)) {
177184
events.push({ ...event, previewInstrument: instrument });
178185
}

0 commit comments

Comments
 (0)