-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmodels.html
More file actions
503 lines (466 loc) · 19.6 KB
/
models.html
File metadata and controls
503 lines (466 loc) · 19.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>MOTIF — Models (lab)</title>
<style>
:root {
--bg: #0b0b0f;
--surface: rgba(0,0,0,0.18);
--border: rgba(255,255,255,0.12);
--text: rgba(255,255,255,0.9);
--muted: rgba(255,255,255,0.7);
--accent: #00ff88;
--accent2: #ff3cf5;
--radius: 14px;
--shadow: 0 26px 90px rgba(0,0,0,0.35);
}
body {
background: radial-gradient(1000px 600px at 20% 10%, rgba(255,60,245,0.10), transparent 55%),
radial-gradient(900px 500px at 80% 20%, rgba(0,255,136,0.09), transparent 50%),
linear-gradient(180deg, #07070a, #0b0b0f 60%, #060609);
color: var(--text);
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
margin: 0;
padding: 48px 20px;
}
.container { max-width: 960px; margin: 0 auto; }
.top {
display:flex; align-items:center; gap: 12px; justify-content: space-between;
margin-bottom: 18px;
}
.title {
margin:0;
color: var(--accent);
text-shadow: 0 0 18px rgba(0,255,136,0.18);
letter-spacing: 0.05em;
}
.pill {
border: 1px solid rgba(255,255,255,0.14);
background: transparent;
color: rgba(255,255,255,0.85);
padding: 8px 10px;
border-radius: 999px;
text-decoration: none;
font-size: 13px;
}
.sub { margin: 0 0 16px 0; color: var(--muted); }
.card {
border: 1px solid var(--border);
border-radius: 18px;
background: var(--surface);
padding: 14px;
box-shadow: var(--shadow);
margin-top: 14px;
}
.row { display:flex; gap: 10px; align-items:center; flex-wrap: wrap; }
input[type="text"] {
flex: 1 1 360px;
padding: 12px 14px;
background: rgba(0,0,0,0.28);
border: 1px solid rgba(255,255,255,0.12);
border-radius: 10px;
color: var(--text);
outline: none;
}
button {
background: rgba(255,255,255,0.06);
border: 1px solid rgba(255,255,255,0.12);
color: rgba(255,255,255,0.86);
padding: 10px 12px;
border-radius: 10px;
cursor: pointer;
}
button.primary {
background: linear-gradient(90deg, rgba(0,255,136,0.18), rgba(255,60,245,0.10));
border-color: rgba(0,255,136,0.28);
}
button:disabled { opacity: 0.5; cursor: not-allowed; }
.status {
margin-top: 10px;
padding: 10px 12px;
border: 1px solid rgba(255,255,255,0.10);
border-radius: 12px;
background: rgba(0,0,0,0.20);
color: rgba(255,255,255,0.75);
}
table { width:100%; border-collapse: collapse; }
th, td { padding: 10px; border-bottom: 1px solid rgba(255,255,255,0.08); text-align:left; }
tr.selected { background: rgba(0,255,136,0.06); }
.toggle { display:flex; gap: 8px; flex-wrap: wrap; align-items:center; }
.model-btn {
display:inline-flex; align-items:center; gap: 8px;
padding: 10px 12px;
border-radius: 999px;
border: 1px solid rgba(255,255,255,0.14);
background: rgba(0,0,0,0.18);
color: rgba(255,255,255,0.86);
font-size: 12px;
line-height: 1;
user-select: none;
}
.model-btn .dot { width: 7px; height: 7px; border-radius: 999px; background: rgba(255,255,255,0.35); }
.model-btn[aria-pressed="true"] {
border-color: rgba(0,255,136,0.35);
background: linear-gradient(90deg, rgba(0,255,136,0.16), rgba(255,60,245,0.10));
}
.model-btn[aria-pressed="true"] .dot { background: rgba(0,255,136,0.85); box-shadow: 0 0 14px rgba(0,255,136,0.22); }
.hint { color: rgba(255,255,255,0.65); font-size: 12px; }
.vol { display:flex; gap: 8px; align-items:center; }
.vol label { color: rgba(255,255,255,0.65); font-size: 12px; }
input[type="range"] { width: 170px; }
</style>
</head>
<body>
<div class="container">
<div class="top">
<h1 class="title">MOTIF — Models</h1>
<a class="pill" href="/" aria-label="Back to main app">Home</a>
</div>
<p class="sub">Lab page. Choose a synthesis model, then click Generate. This page does not modify the main engine.</p>
<div class="card">
<div class="row">
<input id="songInput" type="text" placeholder="Enter song name…" />
<button id="searchBtn" class="primary">Search</button>
</div>
<div id="status" class="status">Ready.</div>
</div>
<div id="resultsCard" class="card" style="display:none;">
<div class="row" style="justify-content: space-between;">
<strong>Search results</strong>
<span class="hint">Pick one MIDI, then compare models.</span>
</div>
<div style="height:10px"></div>
<table>
<thead>
<tr><th>Title</th><th>Source</th><th>Duration</th></tr>
</thead>
<tbody id="resultsBody"></tbody>
</table>
</div>
<div id="playerCard" class="card" style="display:none;">
<div class="row" style="justify-content: space-between;">
<div>
<div id="selectedTitle" style="font-weight:700;">No MIDI selected</div>
<div id="selectedMeta" class="hint">Select a result to enable playback.</div>
</div>
</div>
<div style="height:14px"></div>
<div class="row">
<button id="previewPlayBtn" class="primary" disabled>Play Preview</button>
<button id="previewStopBtn" disabled>Stop</button>
<div class="vol">
<label for="previewVol">Preview vol</label>
<input id="previewVol" type="range" min="0" max="1" step="0.01" value="0.8" />
</div>
<button id="nextResultBtn" disabled>Try Next</button>
</div>
<div style="height:14px"></div>
<div style="height:1px; background: rgba(255,255,255,0.08);"></div>
<div style="height:14px"></div>
<div class="row" style="justify-content: space-between; align-items: baseline;">
<strong>Motif (model test)</strong>
<span id="modelHint" class="hint">Choose a model, then Generate.</span>
</div>
<div style="height:10px"></div>
<div class="row">
<div class="toggle" role="group" aria-label="Synthesis model">
<button class="model-btn" id="modelPre8" type="button" data-model="pre8bit" aria-pressed="false">
<span class="dot" aria-hidden="true"></span> Pre‑8bit
</button>
<button class="model-btn" id="modelNesGb" type="button" data-model="nes_gb" aria-pressed="true">
<span class="dot" aria-hidden="true"></span> NES / GB
</button>
<button class="model-btn" id="modelSnes" type="button" data-model="snes" aria-pressed="false">
<span class="dot" aria-hidden="true"></span> SNES
</button>
</div>
</div>
<div style="height:12px"></div>
<div class="row">
<button id="motifPlayBtn" class="primary" disabled>Generate & Play</button>
<button id="motifStopBtn" disabled>Stop</button>
<div class="vol">
<label for="motifVol">Motif vol</label>
<input id="motifVol" type="range" min="0" max="1" step="0.01" value="0.3" />
</div>
</div>
</div>
</div>
<script type="module" src="/src/models.ts"></script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>MOTIF — Test models</title>
<style>
:root {
--color-bg: #0b0b0f;
--color-surface: rgba(255, 255, 255, 0.06);
--color-surface-2: rgba(255, 255, 255, 0.09);
--color-border: rgba(255, 255, 255, 0.12);
--color-text: rgba(255, 255, 255, 0.9);
--color-text-muted: rgba(255, 255, 255, 0.7);
--color-accent-primary: #00ff88;
--color-accent-secondary: #ff3cf5;
--radius: 12px;
--shadow-sm: 0 12px 34px rgba(0,0,0,0.45);
--glow-primary: 0 0 18px rgba(0, 255, 136, 0.18);
--spacing-unit: 8px;
}
body {
background: radial-gradient(1000px 600px at 20% 10%, rgba(255,60,245,0.10), transparent 55%),
radial-gradient(900px 500px at 80% 20%, rgba(0,255,136,0.09), transparent 50%),
linear-gradient(180deg, #07070a, #0b0b0f 60%, #060609);
color: var(--color-text);
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
margin: 0;
padding: calc(var(--spacing-unit) * 6) calc(var(--spacing-unit) * 3);
}
.container { max-width: 960px; margin: 0 auto; }
h1 {
color: var(--color-accent-primary);
text-align: center;
margin: 0 0 calc(var(--spacing-unit) * 4) 0;
font-size: 2em;
font-weight: 700;
letter-spacing: 0.05em;
text-shadow: var(--glow-primary);
}
.topbar {
display: flex;
align-items: center;
justify-content: center;
gap: calc(var(--spacing-unit) * 2);
margin-bottom: calc(var(--spacing-unit) * 2);
}
.topbar h1 { margin: 0; }
.topbar-actions {
margin-left: auto;
display: inline-flex;
align-items: center;
gap: 8px;
}
.nav-link {
background: transparent;
border: 1px solid rgba(255,255,255,0.14);
color: rgba(255,255,255,0.85);
padding: 8px 10px;
border-radius: var(--radius);
box-shadow: none;
font-size: 13px;
text-decoration: none;
}
.nav-link:hover { box-shadow: var(--shadow-sm); border-color: rgba(255,255,255,0.22); }
.controls { margin: calc(var(--spacing-unit) * 3) 0; text-align: center; }
input[type="text"] {
width: min(600px, 100%);
padding: 12px 14px;
background: rgba(0,0,0,0.28);
border: 1px solid rgba(255,255,255,0.12);
border-radius: 10px;
color: var(--color-text);
outline: none;
}
button {
background: var(--color-surface);
border: 1px solid rgba(255,255,255,0.12);
color: rgba(255,255,255,0.86);
padding: 10px 12px;
border-radius: 10px;
cursor: pointer;
}
button.primary {
background: linear-gradient(90deg, rgba(0,255,136,0.18), rgba(255,60,245,0.10));
border-color: rgba(0,255,136,0.28);
}
button:disabled { opacity: 0.5; cursor: not-allowed; }
#status {
margin-top: 10px;
padding: 10px 12px;
border: 1px solid rgba(255,255,255,0.10);
border-radius: 12px;
background: rgba(0,0,0,0.20);
color: rgba(255,255,255,0.75);
}
.section {
border: 1px solid rgba(255,255,255,0.12);
border-radius: 18px;
background: rgba(0,0,0,0.18);
padding: 14px;
box-shadow: 0 26px 90px rgba(0,0,0,0.35);
margin-top: 16px;
}
.section-header { display:flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.section-title { margin: 0; font-size: 18px; }
.section-subtitle { margin: 0; color: rgba(255,255,255,0.65); font-size: 13px; }
.divider { height: 1px; background: rgba(255,255,255,0.08); margin: 12px 0; }
.results-section { display: none; }
.results-section.visible { display: block; }
.results-table { width: 100%; border-collapse: collapse; }
.results-table th, .results-table td { padding: 10px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.results-table tr.selected { background: rgba(0,255,136,0.06); }
.player-section { display: none; }
.player-section.visible { display: block; }
.preview-controls, .motif-controls { display:flex; gap: 10px; align-items:center; flex-wrap: wrap; }
.volume-control { display:flex; align-items:center; gap: 8px; }
.volume-control label { color: rgba(255,255,255,0.65); font-size: 12px; }
input[type="range"] { width: 160px; }
.model-row { display:flex; align-items:center; gap: 10px; flex-wrap: wrap; }
.model-row label { color: rgba(255,255,255,0.7); font-size: 12px; }
.model-toggle {
display: flex;
gap: 8px;
flex-wrap: wrap;
align-items: center;
}
.model-btn {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 10px 12px;
border-radius: 999px;
border: 1px solid rgba(255,255,255,0.14);
background: rgba(0,0,0,0.18);
color: rgba(255,255,255,0.86);
font-size: 12px;
line-height: 1;
user-select: none;
}
.model-btn .dot {
width: 7px;
height: 7px;
border-radius: 999px;
background: rgba(255,255,255,0.35);
}
.model-btn:hover { border-color: rgba(255,255,255,0.22); box-shadow: 0 14px 40px rgba(0,0,0,0.35); }
.model-btn[aria-pressed="true"] {
border-color: rgba(0,255,136,0.35);
background: linear-gradient(90deg, rgba(0,255,136,0.16), rgba(255,60,245,0.10));
}
.model-btn[aria-pressed="true"] .dot {
background: rgba(0,255,136,0.85);
box-shadow: 0 0 14px rgba(0,255,136,0.22);
}
.model-btn:focus-visible {
outline: none;
box-shadow: 0 0 0 3px rgba(0,255,136,0.25), 0 14px 40px rgba(0,0,0,0.35);
}
.ios-audio-banner {
margin-top: 10px;
border: 1px solid rgba(255,255,255,0.10);
border-radius: 12px;
padding: 10px 12px;
background: rgba(0,0,0,0.18);
display:none;
}
.ios-audio-banner .row { display:flex; align-items:center; justify-content:space-between; gap: 10px; }
.ios-audio-banner .state { margin-top: 6px; font-size: 12px; color: rgba(255,255,255,0.65); }
</style>
</head>
<body>
<div class="container">
<div class="topbar">
<h1>🎵 MOTIF</h1>
<div class="topbar-actions">
<a class="nav-link" href="/" aria-label="Back to main app">Home</a>
</div>
</div>
<p style="text-align:center; color: rgba(255,255,255,0.7); margin-top: 0;">Test models: Pre‑8bit → NES/GB → SNES‑ish</p>
<div class="controls">
<input type="text" id="songInput" placeholder="Enter song name..." />
<button id="searchBtn">Search</button>
</div>
<div id="status">Ready. Enter a song name to search for MIDI files.</div>
<div id="resultsSection" class="section results-section">
<div class="section-header">
<h3 class="section-title">Search Results</h3>
<p class="section-subtitle">Pick a MIDI, then compare models.</p>
</div>
<div class="divider"></div>
<table id="resultsTable" class="results-table">
<thead>
<tr>
<th>Title</th>
<th>Source</th>
<th>Duration</th>
</tr>
</thead>
<tbody id="resultsBody"></tbody>
</table>
</div>
<div id="playerSection" class="player-section">
<div id="selectedInfo" class="section">
<div style="display:flex; flex-direction:column; gap: 6px;">
<h4 id="selectedTitle" style="margin:0;">No MIDI selected</h4>
<p id="selectedMeta" style="margin:0; color: rgba(255,255,255,0.7); font-size: 13px;">Select a MIDI file from search results to enable playback</p>
</div>
</div>
<div class="section">
<div class="section-header">
<h3 class="section-title">Preview</h3>
<p class="section-subtitle">Soundfont MIDI preview (baseline).</p>
</div>
<div class="divider"></div>
<div class="preview-controls">
<button id="soundfontPlayBtn" class="primary" disabled>Play Preview</button>
<button id="soundfontStopBtn" disabled>Stop</button>
<div class="volume-control">
<label for="soundfontVolume">Volume</label>
<input type="range" id="soundfontVolume" min="0" max="1" step="0.01" value="0.8" />
</div>
<button id="nextResultBtn" disabled>Try Next Result</button>
</div>
</div>
<div class="section">
<div class="section-header">
<h3 class="section-title">Motif generation</h3>
<p class="section-subtitle">Same MIDI → different synth models.</p>
</div>
<div class="divider"></div>
<div class="model-row">
<label>Model</label>
<div class="model-toggle" role="group" aria-label="Synthesis model">
<button class="model-btn" id="modelBtnPre8" type="button" data-model="pre8bit" aria-pressed="false">
<span class="dot" aria-hidden="true"></span>
Pre‑8bit
</button>
<button class="model-btn" id="modelBtnNesGb" type="button" data-model="nes_gb" aria-pressed="true">
<span class="dot" aria-hidden="true"></span>
NES / GB
</button>
<button class="model-btn" id="modelBtnSnes" type="button" data-model="snes_ish" aria-pressed="false">
<span class="dot" aria-hidden="true"></span>
SNES‑ish
</button>
</div>
<span id="modelHint" style="color: rgba(255,255,255,0.65); font-size: 12px;">Chip: square/triangle/saw flavor, tight envelope, crisp attacks.</span>
</div>
<div class="divider"></div>
<div class="motif-controls">
<button id="motifBtn" class="primary" disabled>Generate & Play</button>
<button id="motifStopBtn" disabled>Stop</button>
<div class="volume-control">
<label for="motifVolume">Volume</label>
<input type="range" id="motifVolume" min="0" max="1" step="0.01" value="0.3" />
</div>
</div>
<div id="iosAudioBanner" class="ios-audio-banner" aria-live="polite">
<div class="row">
<div class="copy" style="color: rgba(255,255,255,0.8); font-size: 13px;">
<strong>iOS Safari:</strong> tap once to enable audio, then press <strong>Generate & Play</strong>.
</div>
<button id="enableAudioBtn" type="button">Enable Audio</button>
</div>
<div id="iosAudioState" class="state">Audio: …</div>
</div>
</div>
</div>
</div>
<script type="module" src="/src/models.ts"></script>
</body>
</html>