diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-18 11:05:37 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-18 11:05:37 +0100 |
| commit | 890f4fdf96945832d5da078cb795266127cf122d (patch) | |
| tree | ecfc93c2ad41df0787aa471d8f0be4991160f683 /tools/mq_editor/index.html | |
| parent | f8f664964594a341884b2e9947f64feea4b925a6 (diff) | |
feat(mq_editor): jog sliders for synth params, reset partials on WAV load, panel refresh after extract
- Clear extractedPartials and editor state when loading a new WAV
- After extract, refresh right panels (re-select if index still valid)
- Synth fields (decay, jitter, spread) get jog sliders: drag to nudge, spring-back on release
- Spread extension limit dashed line: alpha 0.4→0.75, lineWidth 1→1.5, dash [3,4]→[4,3]
handoff(Gemini): mq_editor UX polish — jog sliders, WAV reset, panel refresh, spread line visibility
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'tools/mq_editor/index.html')
| -rw-r--r-- | tools/mq_editor/index.html | 49 |
1 files changed, 46 insertions, 3 deletions
diff --git a/tools/mq_editor/index.html b/tools/mq_editor/index.html index 5e1e5c4..fa7543c 100644 --- a/tools/mq_editor/index.html +++ b/tools/mq_editor/index.html @@ -172,8 +172,14 @@ align-items: center; } .synth-grid span { color: #888; font-size: 12px; } - .synth-grid input[type="number"] { - width: 100%; + .synth-field-wrap { + display: flex; + align-items: center; + gap: 4px; + } + .synth-field-wrap input[type="number"] { + flex: 1; + min-width: 0; background: #333; color: #ccc; border: 1px solid #444; @@ -183,6 +189,37 @@ font-family: monospace; box-sizing: border-box; } + .synth-field-wrap input[type="number"]:focus { border-color: #666; outline: none; } + .jog-slider { + width: 44px; + height: 16px; + background: #1e1e1e; + border: 1px solid #444; + border-radius: 3px; + cursor: ew-resize; + position: relative; + flex-shrink: 0; + user-select: none; + overflow: hidden; + } + .jog-slider::before { + content: ''; + position: absolute; + left: 50%; top: 3px; bottom: 3px; + width: 1px; + background: #484848; + transform: translateX(-50%); + } + .jog-thumb { + position: absolute; + top: 3px; bottom: 3px; + width: 6px; + background: #888; + border-radius: 2px; + left: calc(50% - 3px); + transition: left 0.12s ease; + } + .jog-slider:hover .jog-thumb { background: #aaa; } .synth-grid input[type="number"]:focus { border-color: #666; outline: none; } .synth-section { border-top: 1px solid #444; @@ -362,6 +399,10 @@ playBtn.disabled = false; setStatus('Computing STFT cache...', 'info'); + // Reset partials from previous file + extractedPartials = null; + editor.setPartials(null); + setTimeout(() => { const signal = audioBuffer.getChannelData(0); stftCache = new STFTCache(signal, audioBuffer.sampleRate, fftSize, Math.max(64, parseInt(hopSize.value) || 64)); @@ -458,7 +499,9 @@ setStatus(`Extracted ${result.partials.length} partials`, 'info'); viewer.setPartials(result.partials); viewer.setKeepCount(getKeepCount()); - viewer.selectPartial(-1); + // Refresh panels: re-select if index still valid, else clear + const prevSel = viewer.selectedPartial; + viewer.selectPartial(prevSel >= 0 && prevSel < result.partials.length ? prevSel : -1); } catch (err) { setStatus('Extraction error: ' + err.message, 'error'); |
