Skip to content

Spatializer phase 4: live positioning from the Hothouse knobs - #71

Open
twitzelbos wants to merge 1 commit into
mainfrom
spatializer-live-knobs
Open

Spatializer phase 4: live positioning from the Hothouse knobs#71
twitzelbos wants to merge 1 commit into
mainfrom
spatializer-live-knobs

Conversation

@twitzelbos

Copy link
Copy Markdown
Owner

Summary

Phase 4 of the binaural spatializer — live positioning from the pedal's knobs. Source 1 (the guitar, left in) sweeps around behind you as you turn a knob; the room's distance/reverb/level track the others.

Per the scoping decision: one movable source + live room, the economical realization.

  • Movable source via crossfade: source 1 runs two HRIR convolvers (behind-left + behind-right endpoints, both fed the same mono), and the azimuth knob crossfades their outputs. Real-time-safe — only gains change, no convolver rebuild or IR interpolation. Source 2 (right in) stays fixed in front (new HRIR direction added to tools/hrir-gen; symmetric ITD/ILD ≈ 0 as expected). ~3 convolvers total.
  • Knob control: the main loop reads ADC1 (daisy_bsp::hothouse::Knobs, all six pots) and publishes values through AtomicU32-as-f32-bits (lock-free single-writer/single-reader); the audio ISR reads them each block. K1 = azimuth, K2 = distance (dry/wet balance), K3 = reverb, K6 = master; K4/K5 reserved. Seed 3 has no knobs → runs on defaults.

Signal path

 input L ─► Voice1a [HRIR behind-LEFT ]─┐ crossfade
        └─► Voice1b [HRIR behind-RIGHT]─┴─(azimuth knob)─┐ src1
 input R ─► Voice2  [HRIR FRONT       ]──────────────────┤─► ×gains ─► out
 ½(L+R) ─► air-abs LP ─┬► EarlyReflections ──────────────┤ shared room
                       └► FdnReverb (late) ───────────────┘ (distance/reverb/master)

Verification

  • clippy -D warnings on all three combos (codec / seed3 / renode_test) + fmt clean.
  • The three-convolver app links (DTCM fits) and spatializer_xip.robot boots it from XIP.

Status

Live knob feel + CPU headroom (~⅓–½ at 480 MHz — measure on HW) are HARDWARE-ONLY, pending board time. The movable source is a 2-point crossfade; a denser HRIR set + true interpolation (SDRAM-stored) is the phase-5 stretch, alongside BRIR / head-tracking.

🤖 Generated with Claude Code

Source 1 (left in) becomes live-movable; the rest of the render tracks the knobs.

- Movable source via crossfade: source 1 runs TWO HRIR convolvers (behind-left +
  behind-right endpoints, both fed the same mono) and the azimuth knob crossfades
  their outputs. Real-time-safe — only gains change, no convolver rebuild or IR
  interpolation — the economical realization of "one movable source" (~3
  convolvers total). Source 2 (right in) stays fixed in FRONT (new HRIR direction
  added to tools/hrir-gen; symmetric ITD/ILD ≈ 0 as expected).

- Knob control: the main loop reads ADC1 (daisy_bsp::hothouse::Knobs, all six pots
  on ADC1) and publishes normalized values through AtomicU32-as-f32-bits (lock-free
  single-writer/single-reader); the audio ISR reads them each block. K1 = azimuth,
  K2 = distance (dry/wet balance), K3 = reverb (late-tail level), K6 = master;
  K4/K5 reserved. Seed 3 has no knobs → runs on the defaults (store_param gated
  to the non-seed3 path).

- DSP state refactored to a `make_voice` helper + three convolver scratches; room
  rt60/damping/air-cutoff stay fixed, only levels are knob-driven.

Verify: clippy -D warnings on all three combos (codec/seed3/renode_test) + fmt
clean; the three-convolver app links (DTCM fits) and spatializer_xip.robot boots
it from XIP. Live knob feel + CPU headroom (~⅓–½ at 480 MHz) are HARDWARE-ONLY,
pending board time.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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