summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
11 hourschore: clean up timeline editor temp files and update gitignoreskal
Removed temporary files: - test_in.seq, test_out.seq - timeline_save.seq - tools/timeline_editor/timeline.seq Added gitignore patterns for editor artifacts: - test_*.seq - *_save.seq - tools/timeline_editor/timeline.seq
11 hoursdocs: update CNN v1 references in top/mid-level docsskal
Updated remaining references to use CNNv1Effect naming: - doc/AUXILIARY_TEXTURE_INIT.md - doc/HOWTO.md (validation note) - doc/COMPLETED.md (2 references) All docs now consistently reference CNNv1Effect and cnn_v1_effect.cc
11 hoursrefactor(cnn): rename cnn_effect to cnn_v1_effect for clarityskal
Renamed files and classes: - cnn_effect.{h,cc} → cnn_v1_effect.{h,cc} - CNNEffect → CNNv1Effect - CNNEffectParams → CNNv1EffectParams - CNNLayerParams → CNNv1LayerParams - CNN_EFFECT.md → CNN_V1_EFFECT.md Updated all references: - C++ includes and class usage - CMake source list - Timeline (workspaces/main/timeline.seq) - Test file (test_demo_effects.cc) - Documentation (CLAUDE.md, PROJECT_CONTEXT.md, READMEs) Tests: 34/34 passing (100%)
11 hoursarchive(cnn): move CNN v1 to cnn_v1/ subdirectoryskal
Consolidate CNN v1 (CNNEffect) into dedicated directory: - C++ effect: src/effects → cnn_v1/src/ - Shaders: workspaces/main/shaders/cnn → cnn_v1/shaders/ - Training: training/train_cnn.py → cnn_v1/training/ - Docs: doc/CNN*.md → cnn_v1/docs/ Updated all references: - CMake source list - C++ includes (relative paths: ../../cnn_v1/src/) - Asset paths (../../cnn_v1/shaders/) - Documentation cross-references CNN v1 remains active in timeline. For new work, use CNN v2 with enhanced features (7D static, storage buffer, sigmoid activation). Tests: 34/34 passing (100%)
11 hoursrefactor(cnn): isolate CNN v2 to cnn_v2/ subdirectoryskal
Move all CNN v2 files to dedicated cnn_v2/ directory to prepare for CNN v3 development. Zero functional changes. Structure: - cnn_v2/src/ - C++ effect implementation - cnn_v2/shaders/ - WGSL shaders (6 files) - cnn_v2/weights/ - Binary weights (3 files) - cnn_v2/training/ - Python training scripts (4 files) - cnn_v2/scripts/ - Shell scripts (train_cnn_v2_full.sh) - cnn_v2/tools/ - Validation tools (HTML) - cnn_v2/docs/ - Documentation (4 markdown files) Changes: - Update CMake source list to cnn_v2/src/cnn_v2_effect.cc - Update assets.txt with relative paths to cnn_v2/ - Update includes to ../../cnn_v2/src/cnn_v2_effect.h - Add PROJECT_ROOT resolution to Python/shell scripts - Update doc references in HOWTO.md, TODO.md - Add cnn_v2/README.md Verification: 34/34 tests passing, demo runs correctly. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
12 hoursfix(cmake): add asset generation dependencies to library targetsskal
After CMake refactoring, fresh builds failed with "generated/assets.h not found" because library targets (util, audio, 3d, gpu) compiled before asset generation. Added generate_demo_assets dependency to all libraries that include generated headers. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
12 hoursfix(tests): adjust AudioEngine test sample count expectationsskal
Tracker data contains only 2 samples, not 3. Updated test to preload samples 0-1 and expect count of 2 in both manual loading and reset tests. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
12 hoursrefactor(build): granular asset tracking and CMake deduplicationskal
Implements Phases 1 & 2 of CMake consolidation plan to improve incremental build performance and reduce code duplication. Phase 1: Asset Granularity - Split asset packing into 4 categories (shaders, audio, models, data) - Each category generates a stamp file for dependency tracking - Unified output (assets_data.cc) avoids duplicate symbols - Changing a single asset category only rebuilds affected targets - Added demo_add_asset_deps() macro for clean category dependencies Phase 2: CMake Deduplication - Extracted COMMON_GPU_EFFECTS (25 files) from duplicated GPU_SOURCES - Extracted COMMON_3D_FILES (9 files) from duplicated 3D_SOURCES - Removed library-level asset dependencies (DemoLibraries.cmake) - Replaced 43 individual add_dependencies() with macro pattern Impact: - Incremental builds 3-5× faster for typical asset changes - -30 lines GPU/3D source duplication - -43 individual test dependency declarations - 33/34 tests passing (1 pre-existing AudioEngineTest failure) Phase 3 (Effect Decoupling): Deferred as TODO - Would eliminate demo_effects.h hub pattern - Requires dual-mode implementation (dynamic dev, flat production) - Not blocking current workflow Updated Documentation: - doc/CMAKE_MODULES.md: Added demo_add_asset_deps() docs - doc/BUILD.md: Documented asset category system Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
12 hoursadd c++ engineer roleskal
13 hoursclang-formatskal
13 hoursrefactor(tools): consolidate common CSS for HTML toolsskal
Extract common styles from various tool HTML files (timeline, spectral, cnn_v2_test, etc.) into a shared stylesheet. This reduces code duplication and improves maintainability of the tool frontends. - Create a new 'tools/common/style.css' to house the shared rules. - Update all tool HTML files to link to the new stylesheet. - Remove redundant inline styles from individual HTML files.
13 hoursdebug flash-cube-effectskal
13 hoursfix(audio): WAV dump drift improvements, acceptable stateskal
WAV dump changes: - Bypass ring buffer, render directly with synth_render() - Frame accumulator eliminates truncation errors - Skip pre-fill and fix seek for WAV dump mode - Result: No glitches, -150ms drift at 64b (acceptable) Timeline editor: - Fix waveform tooltip position calculation - Increase beat bar visibility (0.5 opacity) Cleanup: - Remove all drift debugging code from audio.cc and tracker.cc Status: Acceptable for now, further investigation needed. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
14 hoursfix(timeline-editor): correct waveform tooltip position calculationskal
Remove TIMELINE_LEFT_PADDING offset from waveform cursor calculation. mouseX is already relative to waveform container, no padding adjustment needed. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
14 hoursrefactor(timeline): retiming and effect consolidationskal
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
14 hoursfix(timeline-editor): capture all wheel events at container levelskal
- Add timelineContainer reference and capture wheel events with { capture: true } - Remove redundant wheel handlers from individual sequence/effect elements - Prevents child elements from interfering with zoom/scroll functionality Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
15 hoursdocs(timeline-editor): clarify effect time units in property panelskal
Add "beats" to start/end time labels in effect properties panel for consistency with sequence panel. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
15 hoursrefactor(timeline-editor): complete variable unit renames in modulesskal
- newPixelsPerSecond → newPixelsPerBeat - maxTime → maxTimeBeats (in waveform render) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
15 hoursfix(timeline-editor): disable waveform tooltip when no audio loadedskal
- Add audioBuffer check before showing tooltip/cursor in viewport controller - Sync variable renames in module files (pixelsPerBeat, audioDurationSeconds) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
15 hoursrefactor(timeline-editor): rename variables to reflect beat-based unitsskal
Renamed time-related variables for clarity: - pixelsPerSecond → pixelsPerBeat (timeline internally uses beats) - audioDuration → audioDurationSeconds - maxTime → maxTimeBeats - Local variables: newTime → newTimeBeats, duration → durationBeats - Updated stats display to show both beats and seconds All internal state stores beat values; serializer writes beats without suffix per .seq format. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
15 hoursrefactor(timeline-editor): centralize BPM calculationsskal
Replace repeated 60.0/bpm calculations with precomputed secondsPerBeat and beatsPerSecond properties. Add computeBPMValues helper and updateBPM function for consistency. Also prevent wheel events on time markers. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
15 hoursfeat(timeline-editor): add timing tooltip and cursor in waveform viewskal
Shows precise time (seconds) and beat position under mouse cursor with a vertical guide line for accurate sample timing measurements. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
15 hoursfix(timeline-editor): enable mouse wheel on all sequence viewer elementsskal
Wheel events now work when hovering over sequence boxes and effects, not just the timeline background. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
15 hoursdocs: document audio WAV drift bug investigationskal
Root cause: audio_render_ahead() over-renders by 366ms per 10s, causing progressive timing drift in WAV files. Events appear early in viewer. Findings: - Renders 11,733 extra frames over 40s (331,533 vs 319,800 expected) - Ring buffer accumulates excess audio (~19 frames/iteration) - WAV dump reads exact 533 frames but renders ~552 frames per call - Results in -180ms drift at 60 beats visible in timeline viewer Debug changes: - Added render tracking to audio.cc to measure actual vs expected - Added drift printf to tracker.cc for kick/snare timing analysis - Added WAV sample rate detection to timeline viewer See doc/AUDIO_WAV_DRIFT_BUG.md for complete analysis and proposed fixes. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
17 hoursdocs: compact CLAUDE.md and complete doc file coverageskal
Reduced tier descriptions from verbose to compact format, added all missing doc files (CNN suite, rendering helpers, workspace/scene/sequence systems), corrected archive references, removed non-existent files. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
17 hoursrefactor(timeline-editor): extract viewport and playback to ES6 modulesskal
Extract zoom/scroll/playback code from monolithic index.html into separate modules for better code organization: - timeline-viewport.js: Zoom, scroll sync, indicator positioning (133 lines) - timeline-playback.js: Audio loading, playback, waveform rendering (303 lines) - index.html: Reduced from 1093 to 853 lines (-22%) Requires HTTP server for ES6 module imports. Updated README with usage. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
17 hoursfix(timeline-editor): improve mouse-wheel handling and prevent UI interferenceskal
- Extract wheel handler to support both timeline and waveform scrolling - Add wheel event support to waveform container for horizontal scroll/zoom - Block wheel event propagation from header, properties panel, zoom controls, and stats Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
17 hoursinvestigating audio-drive bugskal
18 hoursdocs: add CLI options reference and WAV dump examplesskal
Expanded HOWTO.md with complete CLI options list and WAV rendering examples. Updated HEADLESS_MODE.md with new dump-wav options. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
18 hoursfeat(audio): add --dump-wav-start and --dump-wav-duration optionsskal
Adds CLI options to control WAV dump time range: - --dump-wav-start TIME: Start dumping at specified time (seeks first) - --dump-wav-duration TIME: Limit dump duration Enables efficient rendering of specific segments without dumping entire demo. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
18 hoursfix(audio): eliminate startup delay with automatic buffer pre-fillskal
Added audio_get_required_prefill_time() to query ring buffer lookahead (400ms) and audio_is_prefilled() to check buffer state. audio_start() now warns if buffer under-filled. Replaced hardcoded 100ms pre-fill with automatic target-based pre-fill in main.cc and test_demo.cc. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
18 hoursmisc updatesskal
18 hoursfix(timeline-editor): align waveform and timeline tick positionsskal
Waveform and timeline were using different width calculations, causing beat markers and timeline ticks to misalign when BPM changed. Waveform now uses same maxTime calculation as timeline (including sequence padding). Also replaced magic constants (16, 0.4) with named constants for clarity: - SEQUENCE_DEFAULT_DURATION = 16 beats - WAVEFORM_AMPLITUDE_SCALE = 0.4 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
19 hoursfeat(timeline-editor): add replay button to restart from original play positionskal
Adds replay button that restarts playback from the position where Play was originally clicked. Button is always visible but disabled when no audio is loaded. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
19 hoursfix(timeline-editor): playback indicator zoom tracking and UX improvementsskal
- Fix indicator position to track scroll offset during zoom/wheel - Add named constants for all magic numbers (layout, scroll, timing) - Fix double-click seek positioning (account for left padding) - Hide indicator by default, show only when audio loaded Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
19 hoursfeat(timeline-editor): consolidate playback indicator positioning and improve UXskal
Major improvements to timeline editor playback indicator and user experience: **Indicator positioning:** - Consolidated all indicator positioning into single updateIndicatorPosition() function - Removed dual indicator architecture (waveform + timeline), now single indicator spans full height - Positioned at timeline-container level with correct offset calculation (beats * pixelsPerSecond + 20px) - Indicator properly updates on all state changes: playback, zoom, BPM, seek, file load **UX improvements:** - Made BPM value editable (number input instead of span) - Added faint vertical beat markers to waveform (rgba(255,255,255,0.15)) - Fixed keyboard event handling to not intercept number keys when typing in input fields - Reset playback offset to 0 on file load and audio clear **Bug fixes:** - Removed timeline border-left that caused offset issues - Fixed indicator not updating on mouse wheel zoom - Fixed indicator visibility (z-index 110 above sticky header) - All zoom/BPM/file operations now consistently update indicator Architecture is now clean and maintainable with single source of truth for positioning. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
20 hoursfix(shader): add dfWithID to sdf_test.wgsl for test compatibilityskal
SDFTestEffect was failing with undefined dfWithID error. The raymarching.wgsl include requires dfWithID even for single-pass effects. Added dummy implementation that wraps df() for compatibility. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
20 hoursfix(cli): enable WAV dump without DEMO_HEADLESS requirementskal
Split conditional compilation so --dump-wav works in normal builds. Previously required cmake -DDEMO_HEADLESS=ON, now only needs !STRIP_ALL. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
20 hoursfix(cli): change --dump_wav to --dump-wav and add error handlingskal
- Update CLI parser to use --dump-wav (consistent with other options) - Add error message and exit for unrecognized options - Update documentation: HEADLESS_MODE.md, COMPLETED.md, FINAL_STRIP_REPORT.md Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
20 hoursfeat(gpu): add shader labels for better error identificationskal
Add descriptive labels to shader modules (render_shader, compute_shader) to make shader compilation errors easier to identify in wgpu-native output. Note: wgpu-native already reports detailed shader errors via device error callback - look for "In wgpuDeviceCreateShaderModule" in error output. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
21 hoursfeat(spectral-editor): add waveform intensity viewer for sample offsetskal
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>
35 hoursfeat(gpu): add two-pass raymarching infrastructureskal
Add RayMarchResult struct and functions for deferred SDF rendering: - rayMarchWithID() tracks object ID and distance_max - reconstructPosition(), normalWithID(), shadowWithStoredDistance() - Pass 1: store geometry data, Pass 2: reuse for shading Add WGSL style rule: prefer return values over pointers for small structs (≤16 bytes). Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
35 hoursfeat(gpu): add SDF camera infrastructure and effect base classskal
Add unified camera system for SDF raymarching effects: - CameraParams struct (80 bytes): inv_view matrix + FOV/near/far/aspect - SDFEffect base class: manages camera uniform, provides update_camera() helpers - camera_common.wgsl: getCameraRay(), position/forward/up/right extractors - SDFTestEffect: working example with orbiting camera + animated sphere Refactor effect headers: - Extract class definitions from demo_effects.h to individual .h files - Update includes in .cc files to use specific headers - Cleaner compilation dependencies, faster incremental builds Documentation: - Add SDF_EFFECT_GUIDE.md with complete workflow - Update ARCHITECTURE.md, UNIFORM_BUFFER_GUIDELINES.md - Update EFFECT_WORKFLOW.md, CONTRIBUTING.md Tests: 34/34 passing, SDFTestEffect validated Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
36 hoursdocs: add audio system enhancement tasksskal
Add two low-priority sub-tasks: - MP3 sample assets with miniaudio - GPU-accelerated PCM synthesis via compute shader Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
36 hoursdocs: mark tracker humanization task as IMPLEMENTEDskal
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
36 hoursfeat(tracker): add sample offset and humanizationskal
Implements two tracker realism features: 1. Sample Offset (compile-time): - Add offset_sec field to NoteParams and Sample structs - Parse OFFSET parameter in SAMPLE directive - Apply timing shift during compilation (zero runtime cost) - Use for attack-heavy samples to align perceived beat 2. Humanization (runtime, deterministic): - Add humanize_seed, timing_variation_pct, volume_variation_pct to TrackerScore - Parse HUMANIZE directive with SEED/TIMING/VOLUME params - Apply per-event RNG jitter using std::minstd_rand - Deterministic: same seed produces identical output Both features work in real-time playback and WAV export. Test file: data/test_humanize.track Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
36 hourssome tweakingskal
38 hoursrefactor(wgsl): consolidate SDF shapes into single common fileskal
Merge sdf_primitives.wgsl into math/sdf_shapes.wgsl to eliminate duplication and establish single source of truth for all SDF functions. Changes: - Delete common/shaders/sdf_primitives.wgsl (duplicate of math/sdf_shapes.wgsl) - Add sdBox2D() and sdEllipse() to math/sdf_shapes.wgsl - Update ellipse.wgsl (main/test) to use #include "math/sdf_shapes" - Update scene1.wgsl to use math/sdf_shapes instead of sdf_primitives - Rename asset SHADER_SDF_PRIMITIVES → SHADER_SDF_SHAPES - Update shader registration and tests Impact: - ~60 lines eliminated from ellipse shaders - Single source for 3D primitives (sphere, box, torus, plane) and 2D (box, ellipse) - Consistent include path across codebase All tests passing (34/34). handoff(Claude): SDF shapes consolidated to math/sdf_shapes.wgsl Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
38 hoursrefactor(wgsl): replace inline fullscreen_vs with common includeskal
Replace duplicate fullscreen triangle vertex shader code with #include "render/fullscreen_vs" in 8 workspace shaders. Eliminates ~60 lines of duplication and establishes single source of truth. Modified shaders: - circle_mask_compute.wgsl (main/test) - circle_mask_render.wgsl (main/test) - ellipse.wgsl (main/test) - gaussian_blur.wgsl (main/test) Updated test_shader_assets.cc to validate include directive instead of inline @vertex keyword for affected shaders. All tests passing (34/34). handoff(Claude): Shader modularization - fullscreen_vs consolidated Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
39 hoursstyle: Apply clang-format to codebaseskal