Spatializer phase 3: two sources + mix (behind-left + behind-right, shared room) - #70
Merged
Merged
Conversation
…hared room) Extends the render from one source to two, each placed at its own HRIR direction and summed through a single shared room. - tools/hrir-gen: add a second direction (BEHIND_RIGHT = az135, no ear-swap → right ear leads/louder, the mirror of behind-left). Regenerated hrir_data.rs now carries both pairs; the tool's cue check confirms BEHIND_RIGHT reads ITD −19 samp / ILD −11.2 dB (right leads/louder), a clean mirror. - daisy-spatializer: refactor the direct path into a reusable `Voice` (HRIR convolver + its 48↔64 reblock FIFOs) and run TWO — left input → behind-left, right input → behind-right. The two directs are summed; one SHARED room (early reflections + FdnReverb + air-absorption, fed by the ½(L+R) source mix) externalizes both. Sharing the room is physically right (one room) and the economical choice (one reverb, not two). Unprimed voices contribute silence (their direct buffers start at zero and are left untouched until primed). Compute now ~2 convolvers + 1 room ≈ ⅓–½ CPU at 480 MHz (measure on HW). Two convolver scratches + the reverb/early buffers still fit DTCM. Verify: clippy -D warnings on all three combos (codec/seed3/renode_test) + fmt clean; the two-voice app links (DTCM fits) and spatializer_xip.robot boots it from XIP. On-headphones listening is HARDWARE-ONLY, pending board time. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 3 of the binaural spatializer — from one source to two, each placed at its own HRIR direction and summed through a single shared room. Based on
main(phases 1–2 merged).tools/hrir-gen: add a second direction, BEHIND_RIGHT (az 135°, no ear-swap → right ear leads/louder — the mirror of behind-left). The tool's cue check confirmsITD −19 samp / ILD −11.2 dB, a clean mirror of behind-left's+19 / +11.2.daisy-spatializer: the direct path is refactored into a reusableVoice(HRIR convolver + its 48↔64 reblock FIFOs), and the app runs two — left input → behind-left, right input → behind-right. The two directs are summed; one shared room (early reflections +FdnReverb+ air-absorption, fed by the ½(L+R) source mix) externalizes both. Sharing the room is physically right (one room) and the economical choice (one reverb, not two). Unprimed voices contribute silence.Signal path
Verification
-D warningson all three combos (codec / seed3 / renode_test) + fmt clean.spatializer_xip.robotboots it from XIP.Status / compute
Compute is now ~2 convolvers + 1 room ≈ ⅓–½ CPU at 480 MHz — measure on HW. On-headphones listening is HARDWARE-ONLY, pending board time. Phase 4 next: live positioning from the Hothouse knobs (HRIR interpolation) + wiring the fixed room/direction params to the knobs.
🤖 Generated with Claude Code