diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-15 09:16:06 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-15 09:16:06 +0100 |
| commit | e94ff513689c6477e9c756f58370e4f3490dd675 (patch) | |
| tree | c0b4deb886efe33e1bd242e0dbd639527656e86f /tools/spectral_editor/style.css | |
| parent | c98286860885d1f025cd8cf9da699f174118ccba (diff) | |
feat(spectral-editor): add waveform intensity viewer for sample offset
Add interactive waveform timeline for determining SAMPLE OFFSET values:
Features:
- RMS envelope visualization (10ms windows, normalized)
- Uses synthesized PCM from spectrogram (not original WAV)
- Draggable offset marker with numeric input (0.001s precision)
- Snap-to-onset: auto-detects first transient (threshold 0.01)
- Copy button: generates `SAMPLE <name> OFFSET <seconds>` command
- Top panel (120px) with controls, z-indexed above spectrogram
Design rationale:
- Offset measured on procedural output (matches runtime behavior)
- Interactive workflow: load .spec → inspect → set offset → copy
- Supports tracker compile-time SAMPLE OFFSET feature
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Diffstat (limited to 'tools/spectral_editor/style.css')
| -rw-r--r-- | tools/spectral_editor/style.css | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/tools/spectral_editor/style.css b/tools/spectral_editor/style.css index fa71d1d..48f7463 100644 --- a/tools/spectral_editor/style.css +++ b/tools/spectral_editor/style.css @@ -60,6 +60,8 @@ header h1 { position: relative; background: #1e1e1e; border-right: 1px solid #3e3e42; + display: flex; + flex-direction: column; } #spectrogramCanvas { @@ -506,3 +508,86 @@ header h1 { ::-webkit-scrollbar-thumb:hover { background: #4e4e52; } + +/* Waveform intensity viewer */ +.waveform-container { + position: relative; + height: 120px; + background: #252526; + border-bottom: 1px solid #3e3e42; + display: flex; + flex-direction: column; + flex-shrink: 0; + z-index: 10; +} + +#waveformCanvas { + flex: 1; + width: 100%; + display: block; + cursor: pointer; +} + +.waveform-controls { + display: flex; + align-items: center; + gap: 8px; + padding: 8px 12px; + background: #2d2d30; + border-top: 1px solid #3e3e42; + font-size: 12px; +} + +.waveform-controls label { + color: #cccccc; + font-weight: 500; +} + +.offset-input { + width: 80px; + padding: 4px 8px; + background: #3c3c3c; + border: 1px solid #3e3e42; + border-radius: 3px; + color: #d4d4d4; + font-size: 12px; + font-family: 'Consolas', 'Monaco', monospace; +} + +.offset-input:focus { + outline: none; + border-color: #007acc; +} + +.btn-copy, .btn-snap { + padding: 4px 8px; + background: #0e639c; + border: none; + border-radius: 3px; + color: white; + font-size: 12px; + cursor: pointer; + transition: background 0.2s; +} + +.btn-copy:hover, .btn-snap:hover { + background: #1177bb; +} + +.btn-copy:active, .btn-snap:active { + background: #0d5a8f; +} + +.spectrogram-wrapper { + flex: 1; + position: relative; + overflow: hidden; + z-index: 1; +} + +#spectrogramCanvas { + width: 100%; + height: 100%; + display: block; + cursor: crosshair; +} |
