Added fluidsynth tool

This commit is contained in:
2026-04-07 20:38:52 +02:00
parent 58c263cbaa
commit 12130df968
2 changed files with 250 additions and 0 deletions

View File

@@ -44,6 +44,7 @@
<li><a href="standalone/imu-1/3d.html">3D view using GravitySensor</a></li> <li><a href="standalone/imu-1/3d.html">3D view using GravitySensor</a></li>
<li><a href="standalone/delaunay.html">Delaunay dataset</a></li> <li><a href="standalone/delaunay.html">Delaunay dataset</a></li>
<li><a href="standalone/delaunay-edge-relax.html">Delaunay dataset + Edge relaxation (Currently broken)</a></li> <li><a href="standalone/delaunay-edge-relax.html">Delaunay dataset + Edge relaxation (Currently broken)</a></li>
<li><a href="standalone/fluidsynth-reverb.html">Reverb configurator for FluidSynth CLI UI</a></li>
</ul> </ul>
</li> </li>

View File

@@ -0,0 +1,249 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FluidSynth Reverb</title>
<style>
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: 'Courier New', Courier, monospace;
background: #111;
color: #ccc;
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
padding: 2rem;
}
.card {
background: #1a1a1a;
border: 1px solid #2a2a2a;
border-radius: 6px;
padding: 2rem;
width: 100%;
max-width: 520px;
}
h1 {
font-size: 13px;
font-weight: normal;
color: #666;
letter-spacing: 0.1em;
text-transform: uppercase;
margin-bottom: 1.5rem;
}
.preset-row {
display: flex;
gap: 6px;
flex-wrap: wrap;
margin-bottom: 1.75rem;
}
.preset-row button {
font-family: inherit;
font-size: 11px;
padding: 4px 10px;
background: transparent;
border: 1px solid #333;
border-radius: 3px;
color: #888;
cursor: pointer;
letter-spacing: 0.05em;
transition: border-color 0.15s, color 0.15s;
}
.preset-row button:hover {
border-color: #555;
color: #bbb;
}
.row {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 1rem;
}
.label {
font-size: 12px;
color: #555;
width: 80px;
flex-shrink: 0;
letter-spacing: 0.04em;
}
input[type=range] {
flex: 1;
-webkit-appearance: none;
height: 1px;
background: #333;
outline: none;
cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
-webkit-appearance: none;
width: 12px;
height: 12px;
background: #7ec8e3;
border-radius: 50%;
}
input[type=range]::-moz-range-thumb {
width: 12px;
height: 12px;
background: #7ec8e3;
border: none;
border-radius: 50%;
}
.val {
font-size: 12px;
color: #7ec8e3;
width: 38px;
text-align: right;
flex-shrink: 0;
}
.divider {
border: none;
border-top: 1px solid #222;
margin: 1.5rem 0;
}
.cmd-label {
font-size: 10px;
color: #444;
letter-spacing: 0.1em;
text-transform: uppercase;
margin-bottom: 8px;
}
.cmd-box {
background: #111;
border: 1px solid #222;
border-radius: 4px;
padding: 14px 16px;
font-size: 12px;
color: #7ec8e3;
line-height: 1.9;
white-space: pre;
}
.copy-btn {
margin-top: 10px;
font-family: inherit;
font-size: 11px;
padding: 5px 14px;
background: transparent;
border: 1px solid #333;
border-radius: 3px;
color: #666;
cursor: pointer;
letter-spacing: 0.05em;
transition: border-color 0.15s, color 0.15s;
}
.copy-btn:hover {
border-color: #555;
color: #aaa;
}
.footer {
margin-top: 1.5rem;
font-size: 10px;
color: #333;
letter-spacing: 0.06em;
text-align: right;
}
</style>
</head>
<body>
<div class="card">
<h1>FluidSynth &mdash; Reverb</h1>
<div class="preset-row">
<button onclick="applyPreset(0.85,0.35,85,0.55)">Hall</button>
<button onclick="applyPreset(0.95,0.15,100,0.7)">Cathedral</button>
<button onclick="applyPreset(0.6,0.5,60,0.5)">Room</button>
<button onclick="applyPreset(0.9,0.2,80,0.7)">Chamber</button>
<button onclick="applyPreset(0.4,0.6,40,0.4)">Studio</button>
</div>
<div class="row">
<span class="label">room size</span>
<input type="range" id="room" min="0" max="1" step="0.01" value="0.9">
<span class="val" id="roomVal">0.90</span>
</div>
<div class="row">
<span class="label">damping</span>
<input type="range" id="damp" min="0" max="1" step="0.01" value="0.2">
<span class="val" id="dampVal">0.20</span>
</div>
<div class="row">
<span class="label">width</span>
<input type="range" id="width" min="0" max="100" step="1" value="80">
<span class="val" id="widthVal">80</span>
</div>
<div class="row">
<span class="label">level</span>
<input type="range" id="level" min="0" max="1" step="0.01" value="0.7">
<span class="val" id="levelVal">0.70</span>
</div>
<hr class="divider">
<div class="cmd-label">Paste into fluidsynth shell</div>
<div class="cmd-box" id="cmd"></div>
<button class="copy-btn" onclick="copyCmd()">Copy commands</button>
<div class="footer">Authored by Claude &mdash; Anthropic</div>
</div>
<script>
function update() {
const room = parseFloat(document.getElementById('room').value);
const damp = parseFloat(document.getElementById('damp').value);
const width = parseInt(document.getElementById('width').value);
const level = parseFloat(document.getElementById('level').value);
document.getElementById('roomVal').textContent = room.toFixed(2);
document.getElementById('dampVal').textContent = damp.toFixed(2);
document.getElementById('widthVal').textContent = width;
document.getElementById('levelVal').textContent = level.toFixed(2);
document.getElementById('cmd').textContent =
'set synth.reverb.active 1\n\n' +
'set synth.reverb.room-size ' + room.toFixed(2) + '\n' +
'set synth.reverb.damp ' + damp.toFixed(2) + '\n' +
'set synth.reverb.width ' + width + '\n' +
'set synth.reverb.level ' + level.toFixed(2);
}
function applyPreset(room, damp, width, level) {
document.getElementById('room').value = room;
document.getElementById('damp').value = damp;
document.getElementById('width').value = width;
document.getElementById('level').value = level;
update();
}
function copyCmd() {
navigator.clipboard.writeText(document.getElementById('cmd').textContent).then(() => {
const btn = document.querySelector('.copy-btn');
btn.textContent = 'Copied!';
setTimeout(() => btn.textContent = 'Copy commands', 1500);
});
}
['room','damp','width','level'].forEach(s =>
document.getElementById(s).addEventListener('input', update)
);
update();
</script>
</body>
</html>