<feed xmlns='http://www.w3.org/2005/Atom'>
<title>demo.git/src/generated, branch main</title>
<subtitle>Vide-coded 64k demo system</subtitle>
<id>https://git.taar-o.com/demo.git/atom?h=main</id>
<link rel='self' href='https://git.taar-o.com/demo.git/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/'/>
<updated>2026-02-08T10:44:45Z</updated>
<entry>
<title>chore: Clean up generated files and update project config</title>
<updated>2026-02-08T10:44:45Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-02-08T10:44:45Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=93f9fa15a7bb6a5f29d82fe7037aa0dfa7c88b55'/>
<id>urn:sha1:93f9fa15a7bb6a5f29d82fe7037aa0dfa7c88b55</id>
<content type='text'>
- Remove src/generated/ directory to avoid committing generated code.
- Update .gitignore to exclude src/generated/.
- Stage modifications made to audio tracker, main, and test demo files.
</content>
</entry>
<entry>
<title>build: Include generated file updates resulting from timing decoupling changes</title>
<updated>2026-02-08T10:23:10Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-02-08T10:23:10Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=35c8f59aa869e41f82889feb3e87b6266353aa6d'/>
<id>urn:sha1:35c8f59aa869e41f82889feb3e87b6266353aa6d</id>
<content type='text'>
This commit stages and commits changes to generated files (, , , ) that were modified as a consequence of decoupling the graphics loop from the audio clock. These updates ensure the project builds correctly with the new timing logic.
</content>
</entry>
<entry>
<title>style: Apply clang-format to all source files</title>
<updated>2026-02-08T06:40:29Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-02-08T06:40:29Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=c9195f997f3e797f03ab90464e4158717198a167'/>
<id>urn:sha1:c9195f997f3e797f03ab90464e4158717198a167</id>
<content type='text'>
</content>
</entry>
<entry>
<title>feat(3d): Fix ObjectType::PLANE scaling and consolidate ObjectType mapping</title>
<updated>2026-02-08T06:38:28Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-02-08T06:38:28Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=b8e6929cafa41681f0b27ac104c9cf1d4e510837'/>
<id>urn:sha1:b8e6929cafa41681f0b27ac104c9cf1d4e510837</id>
<content type='text'>
- Implemented correct scaling for planes in both CPU (physics) and GPU (shaders) using the normal-axis scale factor.
- Consolidated ObjectType to type_id mapping in Renderer3D to ensure consistency and support for CUBE.
- Fixed overestimation of distance for non-uniformly scaled ground planes, which caused missing shadows.
- Updated documentation and marked Task A.2 as completed.
</content>
</entry>
<entry>
<title>feat(3d): Implement Blender export and binary scene loading pipeline</title>
<updated>2026-02-08T06:00:28Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-02-08T06:00:28Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=1bc1cf8cd2c66bbae615a5ddba883b7cd55bd67f'/>
<id>urn:sha1:1bc1cf8cd2c66bbae615a5ddba883b7cd55bd67f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>fix(audio): Calculate sample offsets from render position, not playback position</title>
<updated>2026-02-07T20:34:00Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-02-07T20:34:00Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=727177329f833f76683b53570f3268c39b463e86'/>
<id>urn:sha1:727177329f833f76683b53570f3268c39b463e86</id>
<content type='text'>
This fixes irregular timing in miniaudio playback while WAV dump was correct.

ROOT CAUSE:
Sample offsets were calculated relative to the ring buffer READ position
(audio_get_playback_time), but should be calculated relative to the WRITE
position (where we're currently rendering). The write position is ~400ms
ahead of the read position (the lookahead buffer).

ISSUE TIMELINE:
1. tracker_update() gets playback_time (read pos, e.g., 0.450s)
2. Calculates offset for event at 0.500s: (0.500 - 0.450) * 32000 = 1600 samples
3. BUT: We're actually writing at 0.850s (write pos = read pos + 400ms buffer)
4. Event triggers at 0.850s + 1600 samples = 0.900s instead of 0.500s!
5. Result: Event is 400ms late!

The timing error was compounded by the fact that the playback position
advances continuously between tracker_update() calls (60fps), making the
calculated offsets stale by the time rendering happens.

SOLUTION:
1. Added total_written_ tracking to AudioRingBuffer
2. Added audio_get_render_time() to get write position
3. Updated tracker.cc to use render_time instead of playback_time for offsets

CHANGES:
- ring_buffer.h: Add get_total_written() method, total_written_ member
- ring_buffer.cc: Initialize and track total_written_ in write()
- audio.h: Add audio_get_render_time() function
- audio.cc: Implement audio_get_render_time() using get_total_written()
- tracker.cc: Use current_render_time for sample offset calculation

RESULT:
Sample offsets now calculated relative to where we're currently rendering,
not where audio is currently playing. Events trigger at exact times in both
WAV dump (offline) and miniaudio (realtime) playback.

VERIFICATION:
1. WAV dump: Already working (confirmed by user)
2. Miniaudio: Should now match WAV dump timing exactly

Co-Authored-By: Claude Sonnet 4.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>refactor(audio): Convert tracker to unit-less timing system</title>
<updated>2026-02-07T18:22:43Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-02-07T18:22:43Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=726ae79dd3ba8f368d3a671f371e747c33195edd'/>
<id>urn:sha1:726ae79dd3ba8f368d3a671f371e747c33195edd</id>
<content type='text'>
Changes tracker timing from beat-based to unit-less system to separate
musical structure from BPM-dependent playback speed.

TIMING CONVENTION:
- 1 unit = 4 beats (by convention)
- Conversion: seconds = units * (4 / BPM) * 60
- At 120 BPM: 1 unit = 2 seconds

BENEFITS:
- Pattern structure independent of BPM
- BPM changes only affect playback speed, not structure
- Easier pattern composition (0.00-1.00 for typical 4-beat pattern)
- Fixes issue where patterns played for 2s instead of expected duration

DATA STRUCTURES (tracker.h):
- TrackerEvent.beat → TrackerEvent.unit_time
- TrackerPattern.num_beats → TrackerPattern.unit_length
- TrackerPatternTrigger.time_sec → TrackerPatternTrigger.unit_time

RUNTIME (tracker.cc):
- Added BEATS_PER_UNIT constant (4.0)
- Convert units to seconds at playback time using BPM
- Pattern remains active for full unit_length duration
- Fixed premature pattern deactivation bug

COMPILER (tracker_compiler.cc):
- Parse LENGTH parameter from PATTERN lines (defaults to 1.0)
- Parse unit_time instead of beat values
- Generate code with unit-less timing

ASSETS:
- test_demo.track: converted to unit-less (8 score triggers)
- music.track: converted to unit-less (all patterns)
- Events: beat/4 conversion (e.g., beat 2.0 → unit 0.50)
- Score: seconds/unit_duration (e.g., 4s → 2.0 units at 120 BPM)

VISUALIZER (track_visualizer/index.html):
- Parse LENGTH parameter and BPM directive
- Convert unit-less time to seconds for rendering
- Update tick positioning to use unit_time
- Display correct pattern durations

DOCUMENTATION (doc/TRACKER.md):
- Added complete .track format specification
- Timing conversion reference table
- Examples with unit-less timing
- Pattern LENGTH parameter documentation

FILES MODIFIED:
- src/audio/tracker.{h,cc} (data structures + runtime conversion)
- tools/tracker_compiler.cc (parser + code generation)
- assets/{test_demo,music}.track (converted to unit-less)
- tools/track_visualizer/index.html (BPM-aware rendering)
- doc/TRACKER.md (format documentation)
- convert_track.py (conversion utility script)

TEST RESULTS:
- test_demo builds and runs correctly
- demo64k builds successfully
- Generated code verified (unit-less values in music_data.cc)

Co-Authored-By: Claude Sonnet 4.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>fix(test_demo): Space patterns 4 seconds apart to prevent overlap</title>
<updated>2026-02-07T17:56:01Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-02-07T17:56:01Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=7bda3d5600027de66b8dc635f4b1a7119dcd15ae'/>
<id>urn:sha1:7bda3d5600027de66b8dc635f4b1a7119dcd15ae</id>
<content type='text'>
- Change SCORE triggers from every 2s to every 4s (0.0, 4.0, 8.0, 12.0)
- Patterns are 4 beats (2 seconds at 120 BPM), now properly spaced
- Total duration: 16 seconds (4 patterns × 4 seconds)
- Regenerate test_demo_music.cc
</content>
</entry>
<entry>
<title>chore: Disable tempo variation and simplify music track</title>
<updated>2026-02-07T17:51:23Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-02-07T17:51:23Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=5620cd4bf61e4928f87d1df8d02245e7044048b8'/>
<id>urn:sha1:5620cd4bf61e4928f87d1df8d02245e7044048b8</id>
<content type='text'>
- Force tempo_scale to 1.0 in main.cc (disable variable tempo)
- Comment out some kick pattern events in music.track for cleaner arrangement
- Regenerate music_data.cc from updated track file
</content>
</entry>
<entry>
<title>fix: Auto-regenerate assets after clean build</title>
<updated>2026-02-07T16:22:03Z</updated>
<author>
<name>skal</name>
<email>pascal.massimino@gmail.com</email>
</author>
<published>2026-02-07T16:22:03Z</published>
<link rel='alternate' type='text/html' href='https://git.taar-o.com/demo.git/commit/?id=fb2aa8b608cb423b8b9f140b359b5a0dddbcb43c'/>
<id>urn:sha1:fb2aa8b608cb423b8b9f140b359b5a0dddbcb43c</id>
<content type='text'>
- Added GENERATED property to all generated files
- Added explicit dependencies: audio/3d/gpu libraries depend on generate_demo_assets
- Updated seq_compiler to use GpuContext instead of device/queue/format
- Removed stale test asset files from src/generated (now in build/src/generated_test)

Fixes 'fatal error: generated/assets.h file not found' after make clean.
All 28 tests pass.
</content>
</entry>
</feed>
