summaryrefslogtreecommitdiff
path: root/tools/spectral_editor
AgeCommit message (Collapse)Author
13 hoursfix(spectral_editor): Fix procedural audio and add color-coded curvesskal
Fixed three issues reported during testing: 1. Procedural audio now audible: - Added AMPLITUDE_SCALE=10.0 to match DCT coefficient magnitudes - Amplitude range 0-1 from Y-position now scaled to proper spectral levels 2. Procedural spectrogram now visible: - Each curve rendered separately with its own color - Normalized intensity calculation (specValue / 10.0) - Only draw pixels with intensity > 0.01 for performance 3. Color-coded curves: - Each curve assigned unique color from palette (8 colors cycling) - Colors: Blue, Green, Orange, Purple, Cyan, Brown, Pink, Gold - Control points and paths use curve color - Curve list shows color indicator dot - Procedural spectrogram uses curve colors for easy tracking Visual improvements: - Selected curves have thicker stroke (3px vs 2px) - Each curve contribution visible in separate color - Color dots in sidebar for quick identification Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
13 hoursfix(spectral_editor): Resolve variable name conflict in playAudioskal
Fixed 'Identifier source has already been declared' error at line 935. Bug: Function parameter 'source' (string: 'procedural' or 'original') conflicted with local AudioBufferSourceNode variable. Fix: Renamed local variable to 'bufferSource' for clarity. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
13 hoursfeat(tools): Add Spectral Brush Editor UI (Phase 2 of Task #5)skal
Implement web-based editor for procedural audio tracing. New Files: - tools/spectral_editor/index.html - Main UI structure - tools/spectral_editor/style.css - VSCode-inspired dark theme - tools/spectral_editor/script.js - Editor logic (~1200 lines) - tools/spectral_editor/dct.js - IDCT/DCT implementation (reused) - tools/spectral_editor/README.md - Complete user guide Features: - Dual-layer canvas (reference + procedural spectrograms) - Bezier curve editor (click to place, drag to adjust, right-click to delete) - Profile controls (Gaussian sigma slider) - Real-time audio playback (Key 1=procedural, Key 2=original, Space=stop) - Undo/Redo system (50-action history with snapshots) - File I/O: - Load .wav/.spec files (FFT/STFT or binary parser) - Save procedural_params.txt (human-readable, re-editable) - Generate C++ code (copy-paste ready for runtime) - Keyboard shortcuts (Ctrl+Z/Shift+Z, Ctrl+S/Shift+S, Ctrl+O, ?) - Help modal with shortcut reference Technical: - Pure HTML/CSS/JS (no dependencies) - Web Audio API for playback (32 kHz sample rate) - Canvas 2D for visualization (log-scale frequency) - Linear Bezier interpolation matching C++ runtime - IDCT with overlap-add synthesis Next: Phase 3 (currently integrated in Phase 2) - File loading already implemented - Export already implemented - Ready for user testing! Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>