-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
563 lines (495 loc) · 20.4 KB
/
Copy pathindex.html
File metadata and controls
563 lines (495 loc) · 20.4 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
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PRCE Audio Examples — Master Thesis</title>
<link href="https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,300;0,400;0,500;0,600;1,400&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet" />
<style>
:root {
--bg: #ffffff;
--surface: #f6f6f6;
--border: #e2e2e2;
--border-strong: #b8b8b8;
--text: #111111;
--text-dim: #555555;
--text-muted: #999999;
--col-target: #374151;
--col-hpn: #9a3412;
--col-ptr: #1e40af;
--mono: 'JetBrains Mono', monospace;
--sans: 'Inter', sans-serif;
--r: 4px;
--max-w: 960px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); min-height: 100vh; line-height: 1.6; }
/* ── Header ── */
header { border-bottom: 1px solid var(--border); padding: 40px 24px 28px; }
.header-inner { max-width: var(--max-w); margin: 0 auto; }
.paper-venue {
font-family: var(--mono);
font-size: 11px;
letter-spacing: 0.1em;
text-transform: uppercase;
color: var(--text-muted);
margin-bottom: 10px;
}
.paper-title {
font-size: 26px;
font-weight: 600;
letter-spacing: -0.02em;
line-height: 1.25;
margin-bottom: 10px;
}
.paper-title em { font-style: normal; color: var(--col-ptr); }
.paper-authors {
font-size: 13px;
color: var(--text-dim);
margin-bottom: 4px;
}
.paper-links { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
display: inline-flex; align-items: center; gap: 5px;
font-size: 12px; font-weight: 500;
padding: 4px 13px;
border-radius: 100px;
border: 1px solid var(--border-strong);
color: var(--text);
text-decoration: none;
transition: background 0.15s, border-color 0.15s;
}
.pill:hover { background: var(--surface); border-color: var(--text); }
.pill.primary { background: var(--col-ptr); border-color: var(--col-ptr); color: #fff; }
.pill.primary:hover { background: #1e3a8a; border-color: #1e3a8a; }
/* ── Main ── */
main { max-width: var(--max-w); margin: 0 auto; padding: 36px 24px 100px; }
/* ── Info box ── */
.info-box {
margin-top: 12px;
padding: 14px 18px;
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--r);
font-size: 13px;
color: var(--text-dim);
line-height: 1.8;
}
/* ── Model figure ── */
.fig-block {
margin-bottom: 40px;
padding-bottom: 36px;
border-bottom: 1px solid var(--border);
}
.fig-label {
font-family: var(--mono);
font-size: 10px;
letter-spacing: 0.08em;
text-transform: uppercase;
color: var(--text-muted);
margin-bottom: 10px;
}
.fig-block img {
width: 100%;
border: 1px solid var(--border);
border-radius: var(--r);
display: block;
cursor: zoom-in;
transition: border-color 0.2s;
}
.fig-block img:hover { border-color: var(--border-strong); }
.fig-caption {
margin-top: 10px;
font-size: 12px;
color: var(--text-dim);
line-height: 1.7;
text-align: justify;
}
/* ── Examples section ── */
.section-intro { margin-bottom: 28px; }
.section-intro h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
/* ── Epoch heading ── */
.epoch-heading {
font-size: 15px;
font-weight: 600;
letter-spacing: -0.01em;
margin-top: 48px;
margin-bottom: 24px;
padding-bottom: 8px;
border-bottom: 1px solid var(--border);
}
/* ── Example block ── */
.ex-block { margin-bottom: 52px; }
.ex-head {
display: flex; align-items: baseline; gap: 10px;
margin-bottom: 14px; padding-bottom: 8px;
border-bottom: 1px solid var(--border);
}
.ex-head h3 { font-family: var(--mono); font-size: 13px; font-weight: 500; }
/* ── Column headers ── */
.col-headers {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 10px;
margin-bottom: 8px;
}
.col-hdr {
font-family: var(--mono);
font-size: 11px;
font-weight: 500;
letter-spacing: 0.03em;
padding: 2px 4px;
}
/* ── Row ── */
.row-block { margin-bottom: 10px; }
.row-idx {
font-family: var(--mono);
font-size: 10px;
color: var(--text-muted);
margin-bottom: 5px;
}
.col-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 10px;
}
/* ── Cell: player ── */
.audio-cell {
border: 1px solid var(--border);
border-radius: var(--r);
overflow: hidden;
transition: border-color 0.15s;
}
.audio-cell.playing { border-color: var(--cell-color); }
.spec-img {
width: 100%;
display: block;
height: auto;
background: var(--surface);
}
/* ── Audio player ── */
.aw {
display: flex; align-items: center; gap: 7px;
padding: 5px 8px;
background: var(--surface);
border-top: 1px solid var(--border);
}
.aw-btn {
width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%;
border: none; cursor: pointer; background: transparent;
display: flex; align-items: center; justify-content: center;
transition: transform 0.1s, background 0.15s;
}
.aw-btn:active { transform: scale(0.88); }
.aw-btn svg { width: 8px; height: 8px; pointer-events: none; }
.aw-wave {
flex: 1; height: 20px; cursor: pointer; overflow: hidden;
display: flex; align-items: center; gap: 1.5px; min-width: 0;
}
.aw-bar { flex-shrink: 0; width: 2px; border-radius: 1px; }
.aw-time {
font-family: var(--mono); font-size: 9px; color: var(--text-muted);
min-width: 28px; text-align: right; flex-shrink: 0;
}
/* ── Now playing bar ── */
#now-bar {
position: fixed; bottom: 0; left: 0; right: 0; height: 36px;
background: var(--bg); border-top: 1px solid var(--border);
display: none; align-items: center; padding: 0 24px; gap: 10px; z-index: 100;
font-family: var(--mono); font-size: 10px; color: var(--text-dim);
}
#now-bar.on { display: flex; }
#now-label b { color: var(--text); }
.pulse {
width: 6px; height: 6px; border-radius: 50%;
background: var(--col-ptr);
animation: pulse 1.2s ease-in-out infinite; flex-shrink: 0;
}
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.4;transform:scale(.7)} }
/* ── Lightbox ── */
#lightbox {
display: none; position: fixed; inset: 0; z-index: 500;
background: rgba(0,0,0,0.8); backdrop-filter: blur(6px);
align-items: center; justify-content: center; cursor: zoom-out;
}
#lightbox.on { display: flex; }
#lightbox img { max-width: 92vw; max-height: 92vh; border-radius: var(--r); box-shadow: 0 24px 64px rgba(0,0,0,0.5); }
@media (max-width: 640px) {
.col-grid, .col-headers { grid-template-columns: 1fr; }
.paper-title { font-size: 20px; }
}
</style>
</head>
<body>
<header>
<div class="header-inner">
<div class="paper-venue">Master Thesis — Sound and Music Computing — Universitat Pompeu Fabra</div>
<h1 class="paper-title">Neural Engine Sound Synthesis with <em>Physics-Informed Inductive Biases and Differentiable Signal Processing</em></h1>
<div class="paper-authors">Robin Doerfler<sup>1</sup> · Lonce Wyse<sup>2</sup></div>
<div class="paper-affiliations" style="font-size:11px;color:var(--text-muted);line-height:1.6;margin-bottom:18px;">
<sup>1</sup><a href="mailto:robin.doerfler01@estudiant.upf.edu" style="color:inherit;text-decoration:none;">robin.doerfler01@estudiant.upf.edu</a>, Universitat Pompeu Fabra, Barcelona, Spain ·
<sup>2</sup>Music Technology Group, Universitat Pompeu Fabra, Barcelona, Spain
</div>
<div class="paper-links">
<a class="pill primary" href="https://zenodo.org/records/17304643" target="_blank" rel="noopener">
<svg viewBox="0 0 14 16" width="11" height="11" fill="currentColor" aria-hidden="true">
<path d="M4 0h5.5L14 4.5V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zm0 1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V5H9.5A1.5 1.5 0 0 1 8 3.5V1H4zm5 0v2.5a.5.5 0 0 0 .5.5H12L9 1z"/>
</svg>
Thesis (Zenodo)
</a>
<a class="pill" href="https://github.com/rdoerfler/prce-model" target="_blank" rel="noopener">
<svg viewBox="0 0 16 16" width="11" height="11" fill="currentColor" aria-hidden="true">
<path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"/>
</svg>
Code & Weights
</a>
<a class="pill" href="#examples">Audio Examples ↓</a>
</div>
</div>
</header>
<main>
<div class="fig-block">
<div class="fig-label">Figure 1 — Model Overview</div>
<img src="figures/ptr-model_overview.png" alt="PTR model overview diagram"
onclick="openLightbox(this.src)" title="Click to enlarge" />
<p class="fig-caption">
Control features (RPM, torque) and their deltas are temporally embedded via MLP blocks and GRU.
Outputs are decoded into synth parameters through MLP blocks, converted to parameter ranges by
specialized heads (Pulse, Noise), upsampled to audio rate and scaled by conditioning signals.
Audio is synthesized via differentiable modules with parameter updates calculated from
multi-resolution spectral and harmonic losses.
</p>
</div>
<section id="examples">
<div class="section-intro">
<h2>Audio Examples</h2>
<div class="info-box">
Three conditions are compared:
<strong style="color:var(--col-target)">Target</strong> — ground-truth engine recordings;
<strong style="color:var(--col-hpn)">HPN</strong> — harmonic-plus-noise baseline (same encoder–decoder structure but standard harmonic plus noise synthesis); and
<strong style="color:var(--col-ptr)">PTR (ours)</strong> — the proposed Pulse-Train-Resonator model.
Spectrograms are shown as visual reference. Click ▶ to play, or click the waveform to seek.
</div>
</div>
<div id="table-area"></div>
</section>
</main>
<div id="lightbox" onclick="closeLightbox()">
<img id="lb-img" src="" alt="" />
</div>
<div id="now-bar">
<div class="pulse"></div>
<div id="now-label">—</div>
</div>
<script>
'use strict';
const basePath = '/prce-examples/audiofiles';
const COLUMNS = [
{ key: 'target', label: 'Target', color: '#374151' },
{ key: 'hpn', label: 'HPN', color: '#9a3412' },
{ key: 'ptr', label: 'PTR (ours)', color: '#1e40af' },
];
const DATASETS = ['C', 'B', 'A'];
const SEQUENCES = {
C: [40, 56, 1, 3, 11, 13, 18, 30],
B: [46, 56, 5, 7, 13, 23, 29, 34],
A: [2, 14, 20, 22, 37, 39, 43, 31],
};
const SECTIONS = [
{ type: 'test_inference', heading: 'Best Epoch', description: '' },
{ type: 'epoch_001', heading: 'First Epoch', description:
'These examples reveal the initial inductive biases of each synthesis paradigm after just a single epoch of training. ' +
'Even before meaningful parameter fitting, <strong style="color:#1e40af">PTR</strong> already produces recognizably engine-like sounds: ' +
'the pulse-train structure constrains output to sequential pressure impulses that articulate individual combustion events at low RPM ' +
'and merge into dense harmonic textures at higher RPM, while the Karplus\u2013Strong resonators introduce authentic exhaust-pipe resonance characteristics. ' +
'The result is a signal that is stable, harmonically plausible, and mechanically coherent from the very start of optimization. ' +
'<strong style="color:#9a3412">HPN</strong>, lacking these physics-informed constraints, begins from a less structured initialization\u2014its ' +
'harmonic-plus-noise representation must learn the engine\u2019s temporal and spectral regularities entirely from data, producing noisier ' +
'and less recognizable outputs at this early stage. ' +
'Comparing the two illustrates how domain-specific inductive biases narrow the solution space to physically plausible signals, ' +
'giving PTR a substantial head start in perceptual quality.'
},
];
const specPath = '/prce-examples/spectrograms';
function audioPaths(seqNum, dataset, type) {
const s = String(seqNum).padStart(2, '0');
return {
target: {
audio: `${basePath}/HPN/${dataset}/${type}/targets/targets_${s}.mp3`,
spec: `${specPath}/HPN/${dataset}/${type}/targets/targets_${s}.png`,
},
hpn: {
audio: `${basePath}/HPN/${dataset}/${type}/predictions/predictions_${s}.mp3`,
spec: `${specPath}/HPN/${dataset}/${type}/predictions/predictions_${s}.png`,
},
ptr: {
audio: `${basePath}/PTR/${dataset}/${type}/predictions/predictions_${s}.mp3`,
spec: `${specPath}/PTR/${dataset}/${type}/predictions/predictions_${s}.png`,
},
};
}
let activeAudio = null, activeWidget = null, activeCell = null;
function render() {
const area = document.getElementById('table-area');
for (const section of SECTIONS) {
const sectionHeading = document.createElement('h2');
sectionHeading.className = 'epoch-heading';
sectionHeading.textContent = section.heading;
area.appendChild(sectionHeading);
if (section.description) {
const desc = document.createElement('div');
desc.className = 'info-box';
desc.style.marginBottom = '28px';
desc.innerHTML = section.description;
area.appendChild(desc);
}
for (const dataset of DATASETS) {
const seqs = section.type === 'test_inference'
? SEQUENCES[dataset]
: Array.from({ length: 8 }, (_, i) => i + 1);
const block = document.createElement('div');
block.className = 'ex-block';
const head = document.createElement('div');
head.className = 'ex-head';
head.innerHTML = `<h3>Dataset ${esc(dataset)}</h3>`;
block.appendChild(head);
// Column headers
const colHeaders = document.createElement('div');
colHeaders.className = 'col-headers';
for (const col of COLUMNS) {
const hdr = document.createElement('div');
hdr.className = 'col-hdr';
hdr.style.color = col.color;
hdr.textContent = col.label;
colHeaders.appendChild(hdr);
}
block.appendChild(colHeaders);
for (let i = 0; i < seqs.length; i++) {
const seqNum = seqs[i];
const paths = audioPaths(seqNum, dataset, section.type);
const idx = String(i + 1).padStart(2, '0');
const rowBlock = document.createElement('div');
rowBlock.className = 'row-block';
const rowIdx = document.createElement('div');
rowIdx.className = 'row-idx';
rowIdx.textContent = idx;
rowBlock.appendChild(rowIdx);
const grid = document.createElement('div');
grid.className = 'col-grid';
for (const col of COLUMNS) {
const d = paths[col.key];
const label = `Dataset ${dataset} / ${col.label} / ${idx}`;
const cell = document.createElement('div');
cell.className = 'audio-cell';
cell.style.setProperty('--cell-color', col.color);
const img = document.createElement('img');
img.className = 'spec-img';
img.src = d.spec;
img.alt = `Spectrogram: ${label}`;
img.loading = 'lazy';
cell.appendChild(img);
cell.appendChild(makeWidget(d.audio, col.color, label, cell));
grid.appendChild(cell);
}
rowBlock.appendChild(grid);
block.appendChild(rowBlock);
}
area.appendChild(block);
}
}
}
function makeWidget(url, color, label, cell) {
const wrap = document.createElement('div');
wrap.className = 'aw';
const BAR_N = 40;
const btn = document.createElement('button');
btn.className = 'aw-btn';
btn.innerHTML = svgPlay();
btn.style.color = color;
const waveWrap = document.createElement('div');
waveWrap.className = 'aw-wave';
const bars = Array.from({ length: BAR_N }, () => {
const b = document.createElement('div');
b.className = 'aw-bar';
b.style.cssText = `background:${color};opacity:0.22;height:${15+Math.random()*85}%`;
waveWrap.appendChild(b);
return b;
});
const timeEl = document.createElement('div');
timeEl.className = 'aw-time';
timeEl.textContent = '0:00';
wrap.append(btn, waveWrap, timeEl);
const audio = new Audio();
audio.preload = 'none';
audio.src = url;
const fmt = s => Math.floor(s/60)+':'+Math.floor(s%60).toString().padStart(2,'0');
const updateBars = () => {
if (!audio.duration) return;
const played = Math.floor((audio.currentTime/audio.duration)*BAR_N);
bars.forEach((b,i) => b.style.opacity = i < played ? '0.85' : '0.22');
timeEl.textContent = fmt(audio.currentTime);
};
audio.addEventListener('loadedmetadata', () => timeEl.textContent = fmt(audio.duration));
audio.addEventListener('timeupdate', updateBars);
audio.addEventListener('error', () => { timeEl.textContent = '\u2014'; btn.style.opacity = '0.3'; });
audio.addEventListener('ended', () => {
btn.innerHTML = svgPlay();
cell.classList.remove('playing');
bars.forEach(b => b.style.opacity = '0.22');
if (audio.duration) timeEl.textContent = fmt(audio.duration);
activeAudio = null; activeWidget = null; activeCell = null;
setNowPlaying(null);
});
const stopPrev = () => {
if (!activeAudio) return;
activeAudio.pause();
if (activeWidget) activeWidget.querySelector('.aw-btn').innerHTML = svgPlay();
if (activeCell) activeCell.classList.remove('playing');
};
const toggle = () => {
if (activeAudio && activeAudio !== audio) stopPrev();
if (audio.paused) {
audio.play().catch(() => { timeEl.textContent = 'err'; });
btn.innerHTML = svgPause();
cell.classList.add('playing');
activeAudio = audio; activeWidget = wrap; activeCell = cell;
setNowPlaying(label);
} else {
audio.pause(); btn.innerHTML = svgPlay();
cell.classList.remove('playing');
activeAudio = null; activeWidget = null; activeCell = null;
setNowPlaying(null);
}
};
btn.addEventListener('click', toggle);
waveWrap.addEventListener('click', e => {
if (!audio.duration) { toggle(); return; }
const r = waveWrap.getBoundingClientRect();
audio.currentTime = ((e.clientX-r.left)/r.width)*audio.duration;
updateBars();
});
return wrap;
}
function openLightbox(src) {
document.getElementById('lb-img').src = src;
document.getElementById('lightbox').classList.add('on');
}
function closeLightbox() { document.getElementById('lightbox').classList.remove('on'); }
document.addEventListener('keydown', e => { if (e.key === 'Escape') closeLightbox(); });
function setNowPlaying(label) {
const bar = document.getElementById('now-bar');
const lbl = document.getElementById('now-label');
if (label) {
const parts = label.split(' / ');
lbl.innerHTML = `<b>${esc(parts[0])}</b> / ${esc(parts[1])} / ${esc(parts[2]||'')}`;
bar.classList.add('on');
} else { bar.classList.remove('on'); }
}
function svgPlay() { return `<svg viewBox="0 0 10 10" fill="currentColor"><polygon points="2,1 9,5 2,9"/></svg>`; }
function svgPause() { return `<svg viewBox="0 0 10 10" fill="currentColor"><rect x="1" y="1" width="3" height="8" rx=".8"/><rect x="6" y="1" width="3" height="8" rx=".8"/></svg>`; }
function esc(s) { return String(s).replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); }
render();
</script>
</body>
</html>