Skip to content

Spatializer phase 3: two sources + mix (behind-left + behind-right, shared room) - #70

Merged
twitzelbos merged 1 commit into
mainfrom
spatializer-two-sources
Aug 16, 2026
Merged

Spatializer phase 3: two sources + mix (behind-left + behind-right, shared room)#70
twitzelbos merged 1 commit into
mainfrom
spatializer-two-sources

Conversation

@twitzelbos

Copy link
Copy Markdown
Owner

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 confirms ITD −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 reusable Voice (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

 input L ─► Voice1 [48→64 ► HRIR behind-LEFT  ► 64→48] ─┐ direct
 input R ─► Voice2 [48→64 ► HRIR behind-RIGHT ► 64→48] ─┤─► + ─► out
 ½(L+R) ─► air-abs LP ─┬► EarlyReflections ─────────────┤
                       └► FdnReverb (late) ──────────────┘ shared room

Verification

  • clippy -D warnings on all three combos (codec / seed3 / renode_test) + fmt clean.
  • The two-voice app links (two convolver scratches + reverb/early buffers fit DTCM) and spatializer_xip.robot boots 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

…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>
@twitzelbos
twitzelbos merged commit 52ea03c into main Aug 16, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant