Repository navigation
Expand file tree
/
Copy patheditor.html
More file actions
308 lines (296 loc) · 22.3 KB
/
Copy patheditor.html
File metadata and controls
308 lines (296 loc) · 22.3 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>MultiStomp Editor</title>
<!--
The Patch Editor in Modwerk's design. Same editor: this page fetches
patch_editor.html at load and runs its markup and script unchanged, under
this stylesheet and layout. Every behaviour (MIDI, writes, the effect
installer) stays in patch_editor.html; only the look and arrangement live
here. Serve the repo root over http://localhost (Web MIDI needs it) and open
/tools/editor.html.
-->
<style>
/* Modwerk tokens (modwerk src/styles.css). The editor's canvases read the
--knob-* and --screen-* tokens when they draw. */
:root{
--background:#19191c; --sidebar:#212124; --surface:#2c2c31; --surface-raised:#303036;
--surface-hover:#38383f; --field:#1a1a1e; --preview:#232328; --line:#3d3d45; --line-hover:#60606b;
--control-border:#55555f; --text:#f5f5f8; --text-secondary:#dadade; --muted:#bebec9; --faint:#afafbd;
--accent:#a5adff; --accent-hover:#c0c6ff; --accent-ink:#171722; --accent-soft:#353540; --accent-line:#626574;
--ok:#7ed3a0; --warn:#f0b95e; --err:#f08a7e;
--mono:"SFMono-Regular",Consolas,monospace;
--radius:10px;
--knob-bg:#25252a; --knob-fg:#a5adff; --knob-dim:#3d3d45;
--screen-bg:#111114; --screen-fg:#dfe2ff;
/* names the editor's markup uses */
--ink:var(--text); --ink-soft:var(--line); --panel:var(--surface); --dim:var(--faint); --b:1px;
color-scheme:dark;
}
*{box-sizing:border-box}
html,body{margin:0;background:var(--background);color:var(--text)}
body{font:14px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;-webkit-font-smoothing:antialiased}
button,select,input,textarea{font:inherit;color:inherit}
button{background:var(--surface-raised);border:1px solid var(--control-border);border-radius:8px;padding:7px 12px;cursor:pointer;min-height:34px}
button:hover{background:var(--surface-hover);border-color:var(--line-hover)}
button:disabled{opacity:.45;cursor:default}
button.primary,#connect{background:var(--accent);color:var(--accent-ink);border-color:var(--accent);font-weight:600}
button.primary:hover,#connect:hover{background:var(--accent-hover)}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
select,input[type=text],textarea{background:var(--field);border:1px solid var(--control-border);border-radius:8px;padding:6px 10px}
select{appearance:none;padding-right:28px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%23bebec9' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4.5l3 3 3-3'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center}
a{color:var(--accent)}
input[type=file]::file-selector-button{margin-right:10px;background:var(--surface-raised);color:var(--text);border:1px solid var(--control-border);border-radius:8px;padding:6px 12px;font:inherit;cursor:pointer}
.hint{color:var(--muted);font-size:13px}
[hidden]{display:none!important}
/* the original page's furniture this layout does not use */
#pe>h1,#pe>.sub,#pe .main>#libpanel>h2,#pe .collapse,#saveHelp{display:none!important}
/* ---- shell ---- */
.mw{display:grid;grid-template-columns:280px minmax(0,1fr);grid-template-rows:auto 1fr;min-height:100dvh}
.mw-top{grid-column:1/-1;position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:14px;flex-wrap:wrap;
padding:12px 20px;background:rgba(25,25,28,.92);backdrop-filter:blur(8px);border-bottom:1px solid var(--line)}
.mw-brand{display:flex;flex-direction:column;line-height:1.1;margin-right:6px}
.mw-brand b{font-size:15px;letter-spacing:.2px}
.mw-brand small{font-family:var(--mono);font-size:11px;color:var(--faint);letter-spacing:1px;text-transform:uppercase}
.mw-top .spacer{flex:1}
#connectionState{font-size:12px;font-family:var(--mono);color:var(--muted);padding:4px 10px;border:1px solid var(--line);border-radius:999px}
#currentPatch{font-size:17px;font-weight:600;max-width:32ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#editStatus{font-size:12px;color:var(--muted)}
.dspmeter{display:inline-flex;align-items:center;gap:8px;font-family:var(--mono);font-size:12px;color:var(--muted)}
.dspmeter .bar{width:110px;height:6px;background:var(--line);border-radius:999px;overflow:hidden;display:block;padding:0;border:0}
.dspmeter .bar i{display:block;height:100%;width:0;background:var(--ok);border-radius:999px;transition:width .2s}
.dspmeter.near .bar i{background:var(--warn)} .dspmeter.full .bar i{background:var(--err)}
.mw-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.mw-actions [role=group]{display:flex;gap:8px;margin:0;padding:0}
.mw-classic{font-size:12px;color:var(--faint);text-decoration:none;border:1px solid var(--line);border-radius:999px;padding:4px 10px}
.mw-classic:hover{color:var(--text);border-color:var(--line-hover)}
/* ---- sidebar: the pedal's patches ---- */
.mw-side{background:var(--sidebar);border-right:1px solid var(--line);padding:16px 12px;overflow:auto;max-height:calc(100dvh - 63px);position:sticky;top:63px}
.mw-side h2{font-size:11px;font-weight:600;letter-spacing:1.4px;text-transform:uppercase;color:var(--faint);margin:4px 8px 10px}
.mw-side .tools{display:flex;gap:6px;flex-wrap:wrap;margin:0 4px 12px}
.mw-side .tools button{min-height:30px;padding:4px 10px;font-size:12px}
#librows{display:flex;flex-direction:column;gap:2px}
#librows.hint{padding:0 8px}
.librow{display:flex;align-items:center;gap:10px;padding:6px 8px;border-radius:7px;cursor:pointer}
.librow:hover{background:var(--surface)}
.librow.cur{background:var(--accent-soft);box-shadow:inset 2px 0 0 var(--accent)}
.librow .num{font-family:var(--mono);font-size:11px;color:var(--faint);width:22px;text-align:right;flex:none}
.librow .nm{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.librow button{min-height:24px;padding:0 6px;font-size:11px;background:transparent;border-color:transparent;color:var(--faint)}
.librow button:hover{color:var(--text);border-color:var(--line)}
/* ---- main: the six slots ---- */
.mw-main{padding:20px 22px 110px;min-width:0}
.mw-chainbar{display:flex;align-items:center;justify-content:space-between;gap:10px 14px;flex-wrap:wrap;margin:0 0 14px}
.mw-chainbar [role=group]{display:flex;gap:8px;flex-wrap:wrap;margin:0;padding:0}
.mw-chainbar [role=group] button{min-height:30px;padding:4px 12px;font-size:13px}
#operationStatus{margin:0;color:var(--muted);font-size:13px}
#emptyEditor{background:var(--surface);border:1px dashed var(--line-hover);border-radius:var(--radius);padding:28px;margin-bottom:16px}
#emptyEditor h2{margin:0 0 6px;font-size:18px}
#emptyEditor p{margin:0;color:var(--muted)}
#slots{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.slot{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:12px 14px 14px;display:flex;flex-direction:column;gap:10px;min-width:0;transition:border-color .15s}
.slot.on{border-color:var(--accent-line)}
.slot h3{display:flex;align-items:center;gap:8px;margin:0;font-size:11px;font-weight:600;letter-spacing:1.4px;text-transform:uppercase;color:var(--faint)}
.slot .slot-state{font-family:var(--mono);font-size:11px;letter-spacing:.5px;text-transform:none;color:var(--muted)}
.slot.on .slot-state{color:var(--ok)}
.slot .toggle{width:38px;min-height:22px;height:22px;padding:0;border-radius:999px;position:relative;background:var(--line);border-color:var(--control-border)}
.slot .toggle::after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:var(--muted);transition:transform .15s,background .15s}
.slot .toggle.on{background:var(--accent-soft);border-color:var(--accent)}
.slot .toggle.on::after{transform:translateX(16px);background:var(--accent)}
.slot>select{width:100%;font-weight:600;background-color:var(--field)}
.slot canvas.cover{width:100%;height:auto;aspect-ratio:2/1;image-rendering:pixelated;border-radius:6px;border:1px solid var(--line);background:var(--screen-bg)}
.slot .bypassHint{font-size:12px;color:var(--warn)!important}
.knobs{display:grid;grid-template-columns:repeat(auto-fill,minmax(64px,1fr));gap:8px 6px}
.knob{display:flex;flex-direction:column;align-items:center;gap:2px;min-width:0}
.variant-bar{display:flex;align-items:center;gap:6px;margin-top:-2px}
.variant-bar button{min-height:26px;width:30px;padding:0;font-size:11px}
.variant-label{flex:1;min-width:0;text-align:center;font-family:var(--mono);font-size:11px;color:var(--text-secondary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.knob .kl{font-size:11px;color:var(--muted);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.knob .kv{font-family:var(--mono);font-size:12px;color:var(--text-secondary)}
.knob canvas{cursor:ns-resize;border-radius:50%}
.knob.mode-selector select{max-width:100%;font-size:11px;padding:2px 22px 2px 6px;min-height:24px;background-position:right 6px center}
.slot.padactive{box-shadow:0 0 0 2px var(--accent)}
/* the whole chain in one row, like on the pedal */
@media(min-width:1440px){
#slots{grid-template-columns:repeat(6,minmax(0,1fr));gap:10px}
.slot{padding:10px 10px 12px}
.knobs{grid-template-columns:repeat(auto-fill,minmax(56px,1fr));gap:8px 2px}
}
@media(max-width:1180px){#slots{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:820px){
.mw{grid-template-columns:1fr}
.mw-side{position:static;max-height:none;border-right:0;border-bottom:1px solid var(--line)}
#librows{max-height:240px;overflow:auto}
#slots{grid-template-columns:1fr}
.mw-top{padding:10px 16px}.mw-main{padding:16px 16px 110px}
}
/* ---- side panels (Library, Effects, Settings) and dialogs ---- */
dialog{color:var(--text);background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:22px}
dialog::backdrop{background:rgba(8,8,10,.6)}
dialog.drawer{position:fixed;inset:0 0 0 auto;margin:0;width:min(720px,96vw);max-width:96vw;height:100dvh;max-height:100dvh;border-radius:0;border-width:0 0 0 1px;overflow:auto;padding:22px 24px 96px;background:var(--sidebar)}
.drawer-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}
.drawer-head h2{margin:0;font-size:20px;font-weight:600}
.drawer-head button{min-height:32px;width:32px;padding:0}
.drawer h3{font-size:13px;letter-spacing:.4px;margin:18px 0 6px}
.drawer .bar{display:flex;gap:8px;flex-wrap:wrap;padding:10px 0;align-items:center}
.drawer details{border-top:1px solid var(--line);padding:14px 0}
.drawer summary{cursor:pointer;font-weight:600}
.drawer [role=tablist]{display:flex;gap:6px}
.drawer [role=tab][aria-selected=true]{background:var(--accent-soft);border-color:var(--accent)}
.drawer .strip,.drawer .panel{background:transparent;border:0;padding:0;margin:8px 0}
.drawer .striptools{display:flex;gap:6px;flex-wrap:wrap;margin:8px 0}
.drawer label{display:inline-flex;align-items:center;gap:6px}
#locrows,#librows-local{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}
#fxRows,#fxStockRows,#fxNamRows{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr) minmax(0,1fr) auto;gap:6px 12px;align-items:center;margin:8px 0}
#fxRows .head,#fxStockRows .head,#fxNamRows .head{font-size:11px;letter-spacing:1.2px;text-transform:uppercase;color:var(--faint)}
#fxRows>div:not(.head),#fxStockRows>div:not(.head),#fxNamRows>div:not(.head){padding:3px 0;border-bottom:1px solid var(--line)}
#fxRows .acts,#fxStockRows .acts,#fxNamRows .acts{display:flex;gap:6px;justify-content:flex-end;border-bottom:1px solid var(--line)}
#fxRows button,#fxStockRows button,#fxNamRows button{min-height:28px;padding:2px 10px;font-size:12px}
#fxStatus,#fxStockStatus,#fxNamStatus{color:var(--muted)}
.nam-dsp{display:flex;gap:12px;align-items:baseline;flex-wrap:wrap;margin:4px 0 10px}
.drawer details.info{display:inline;border:0;padding:0;font-weight:400;letter-spacing:0}
.drawer details.info>summary{display:inline;color:var(--faint);font-weight:400}
.drawer details.info[open]>p{display:block;font-size:13px;color:var(--text-secondary);margin:6px 0 2px;max-width:62ch;line-height:1.5}
.nam-links{display:flex;gap:16px;margin-top:14px}
.nam-form label[hidden]{display:none!important}
.src-row{display:flex;flex-wrap:wrap;gap:8px 10px;align-items:center;margin:10px 0 6px}
.src-row .or{color:var(--faint);font-size:13px}
.ident-row{display:flex;flex-wrap:wrap;gap:14px 18px;align-items:flex-start;margin:10px 0}
.ident-fields{display:flex;flex-direction:column;gap:10px;min-width:180px}
.ident-fields label{display:flex!important;flex-direction:column;align-items:stretch!important;gap:4px;font-size:12px;color:var(--muted)}
.lcd-preview{width:192px;height:auto;image-rendering:pixelated;border-radius:6px;border:1px solid var(--line)}
#namCabDrawer h3{margin-top:22px}
.t3k-row{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:flex-end;margin:4px 0 6px;padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--surface)}
.t3k-brand{flex-basis:100%} .t3k-logo{height:20px;display:block}
.t3k-btn{display:inline-flex;align-items:center;gap:8px} .t3k-mark{height:14px}
.t3k-pick{align-items:center!important;gap:10px 14px!important;padding:10px 12px;border:1px solid var(--line);border-radius:10px}
.t3k-art{width:44px;height:44px;object-fit:cover;border-radius:6px;flex:none}
.t3k-credit{display:flex;flex-direction:column;gap:2px;font-size:14px;min-width:0;flex:1}
.t3k-credit>a{color:var(--text);font-weight:600;text-decoration:none} .t3k-credit>a:hover{text-decoration:underline}
.t3k-credit .by{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--muted)} .t3k-credit .by a{color:var(--muted)}
.t3k-avatar{width:16px;height:16px;border-radius:50%}
.t3k-pick label[hidden]{display:none!important}
.ident-fields label[hidden]{display:none!important}
.pack{flex-basis:100%;display:flex;flex-direction:column;gap:2px;margin-top:6px;border-top:1px solid var(--line);padding-top:8px}
.pack-head{display:flex;justify-content:space-between;align-items:center;font-size:12px;color:var(--muted);margin-bottom:4px}
.pack-head button{min-height:26px;padding:2px 10px;font-size:12px}
.t3k-pick .pack-row{display:flex!important;flex-direction:row!important;align-items:center!important;gap:10px;font-size:13px;color:var(--text);padding:3px 0}
.pack-row .lbl{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pack-row input[type=text]{width:10ch;padding:3px 8px;font-family:var(--mono);font-size:12px}
.pack-row input[type=checkbox]{accent-color:var(--accent);width:16px;height:16px}
.t3k-row label{display:flex!important;flex-direction:column;align-items:stretch!important;gap:4px;font-size:12px;color:var(--muted)}
.t3k-row label[hidden],.t3k-row [hidden]{display:none!important}
.t3k-row #t3kStatus{flex-basis:100%}
.t3k-row button.link{background:none;border:0;color:var(--faint);text-decoration:underline;min-height:0;padding:4px}
.t3k-pick{display:flex;flex-wrap:wrap;gap:6px 14px;align-items:flex-end;margin:0 0 10px}
.t3k-pick label{display:flex!important;flex-direction:column;align-items:stretch!important;gap:4px;font-size:12px;color:var(--muted)}
#fxNamDspText{flex:1;min-width:240px}
.drawer .dspmeter .bar{display:block;padding:0;width:110px;height:6px;flex:none} /* not the drawer's button rows (.bar) */
.nam-form{display:flex;flex-wrap:wrap;gap:10px 14px;align-items:flex-end;margin:12px 0}
.nam-form label{display:flex!important;flex-direction:column;align-items:stretch!important;gap:4px;font-size:12px;color:var(--muted)}
#fxNamNotes{display:inline-flex;align-items:center;min-height:34px;padding:0 12px;border:1px solid var(--accent);border-radius:8px;text-decoration:none}
#fxSave{display:inline-flex;align-items:center;min-height:34px;padding:0 12px;border:1px solid var(--accent);border-radius:8px;text-decoration:none}
#log{font-family:var(--mono);font-size:11px;color:var(--muted);white-space:pre-wrap;max-height:300px;overflow:auto;background:var(--field);border:1px solid var(--line);border-radius:8px;padding:8px}
#diagpanel{font-size:13px}
#diagpanel details{padding:8px 0}
form[method=dialog] p{max-width:62ch;color:var(--text-secondary)}
.support-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:10px;margin-top:18px}
.support-actions a{display:inline-flex;align-items:center;min-height:34px;padding:0 12px;border:1px solid var(--control-border);border-radius:8px;text-decoration:none;color:var(--text)}
.support-actions a.primary{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
/* ---- notification bar ---- */
#noticeBar{position:fixed;left:50%;bottom:16px;transform:translateX(-50%);z-index:10000;display:flex;align-items:center;gap:12px;
max-width:min(860px,calc(100vw - 32px));padding:10px 12px 10px 16px;background:var(--surface-raised);border:1px solid var(--line-hover);border-radius:12px;box-shadow:0 10px 30px rgba(0,0,0,.4)}
#noticeBar>.hint{display:none}
#noticeText{flex:1;min-width:0;font-size:13px}
#noticeBar button{min-height:30px;padding:2px 10px;font-size:12px}
#openSupport{display:inline-flex;gap:6px;align-items:center}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}
#mwLoading{padding:40px;color:var(--muted)}
</style>
</head>
<body>
<div class="mw">
<header class="mw-top" id="mwTop">
<div class="mw-brand"><b>MultiStomp Editor</b><small id="mwModel">Not connected</small></div>
</header>
<aside class="mw-side" id="mwSide" aria-label="Patches on the pedal">
<h2>Patches on the pedal</h2>
<div class="tools" id="mwSideTools"></div>
</aside>
<main class="mw-main" id="mwMain"><p id="mwLoading">Loading the editor…</p></main>
</div>
<div id="pe" hidden></div>
<script>
"use strict";
// Load the editor itself (markup and script) from patch_editor.html, then arrange it.
(async function boot(){
const fail=msg=>{document.getElementById("mwLoading").textContent=msg;};
let html;
try{ const r=await fetch("patch_editor.html",{cache:"no-store"}); if(!r.ok)throw new Error(r.status); html=await r.text(); }
catch(e){ fail("Could not load patch_editor.html ("+e.message+"). Serve the repo over http://localhost and open /tools/editor.html."); return; }
const doc=new DOMParser().parseFromString(html,"text/html");
const scripts=[...doc.body.querySelectorAll("script")];
const main=scripts.filter(s=>!s.src).pop();
for(const s of scripts)s.remove();
const pe=document.getElementById("pe");
pe.append(...[...doc.body.childNodes].map(n=>document.importNode(n,true)));
// cover_art.js first (the editor's script uses it), then the editor's script.
for(const s of scripts.filter(s=>s.getAttribute("src"))){
await new Promise((res,rej)=>{const el=document.createElement("script");el.src=s.getAttribute("src");el.onload=res;el.onerror=()=>rej(new Error(el.src));document.head.appendChild(el);});
}
window.MW_SHELL=true; // this page shows the pedal's model itself (top left)
const el=document.createElement("script");el.textContent=main.textContent;document.body.appendChild(el);
arrange();
})();
function arrange(){
const $=id=>document.getElementById(id);
// This page has one look; the original's screen styles do not apply here.
document.documentElement.removeAttribute("data-theme");
const theme=$("theme"); if(theme){const d=theme.closest("details");(d||theme.closest("label")||theme).hidden=true;}
if($("motionwrap"))$("motionwrap").hidden=true;
// Top bar: connection, the patch, DSP, then the actions.
const top=$("mwTop");
const status=document.createElement("div");status.className="mw-actions";
for(const id of ["connect","connectionState"])status.appendChild($(id));
const patch=document.createElement("div");patch.className="mw-actions";patch.style.flex="1";patch.style.minWidth="220px";
for(const id of ["currentPatch","dspmeter","editStatus"])patch.appendChild($(id));
const acts=document.createElement("div");acts.className="mw-actions";
for(const id of ["openLibrary","openEffects","openNamCab","openSettings"])if($(id))acts.appendChild($(id));
const classic=document.createElement("a");classic.href="patch_editor.html";classic.className="mw-classic";classic.textContent="Classic editor";classic.title="The original Patch Editor (same features)";
acts.appendChild(classic);
top.append(status,patch,acts);
const toolbar=$("mainToolbar");if(toolbar)toolbar.hidden=true;
// Sidebar: the pedal's 50 patches, with reload and re-read.
const sideTools=$("mwSideTools");
for(const id of ["readall","reread"])if($(id))sideTools.appendChild($(id));
$("mwSide").appendChild($("librows"));
// The Library panel keeps only "My Library"; the pedal's list now lives in the sidebar.
if($("pedalTab")){$("pedalTab").hidden=true;$("browserTab").click();$("browserTab").hidden=true;}
for(const [btn,title,name] of [["openLibrary","libraryTitle","Patch Library"],["openEffects","effectsTitle","Effects Library"]]){
if($(btn))$(btn).textContent=name;
if($(title))$(title).textContent=name;
}
// Main: status, the empty state, the six slots.
const m=$("mwMain");m.textContent="";
// Above the chain: the status line, and the controls that act on the whole chain.
const chainbar=document.createElement("div");chainbar.className="mw-chainbar";
if($("operationStatus"))chainbar.appendChild($("operationStatus"));
const perf=document.querySelector('[aria-label="Pedal performance controls"]');if(perf)chainbar.appendChild(perf);
m.appendChild(chainbar);
for(const id of ["emptyEditor","slots"])if($(id))m.appendChild($(id));
// The rest (dialogs, drawers, log, notification bar) stays where the editor put it.
const pe=$("pe");pe.hidden=false;
for(const n of [...pe.children])if(!(n.tagName==="DIALOG"||n.id==="noticeBar"))n.hidden=true;
// Redraw slots with this page's tokens (the knobs read them when drawn).
try{ if(typeof render==="function")render(); }catch(e){}
const model=$("mwModel");
// The pedal's own answer (patch_editor.html's PEDAL_ID): model and firmware once it has said who it is.
const syncModel=()=>{try{const on=!!midiOut&&midiOut.state!=="disconnected";
model.textContent=PEDAL_ID?PEDAL_ID.model+(PEDAL_ID.fw?" · "+PEDAL_ID.fw:"")+(READ_ONLY?" · read-only":""):on?"Connecting…":"Not connected";}catch(e){}};
syncModel();setInterval(syncModel,2000);
}
</script>
</body>
</html>