From f74e981fd9f8092c56f9c064d064706f4080bc08 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 13 Nov 2026 13:11:33 +0700 Subject: [PATCH 1/8] feat(sonku): offline bounded room geometry and inverse-distance binaural cues --- .../builtin_fx/sonku/SonKuEarlyReflections.h | 56 ++++++++++++++++--- 1 file changed, 49 insertions(+), 7 deletions(-) diff --git a/engine/builtin_fx/sonku/SonKuEarlyReflections.h b/engine/builtin_fx/sonku/SonKuEarlyReflections.h index 501cccfca..25c40be4f 100644 --- a/engine/builtin_fx/sonku/SonKuEarlyReflections.h +++ b/engine/builtin_fx/sonku/SonKuEarlyReflections.h @@ -13,6 +13,12 @@ // No allocation, locks, worker, I/O, FFT or second device callback. namespace armix::sonku { enum class SonKuRoomShape : std::uint8_t { Rectangular=0, Square=1 }; +// Offline-only center-listener geometry. Width/depth are full room spans; +// the source moves on a horizontal ring at distanceMeters from the listener. +// No realtime mutation or native state schema is published by this experiment. +struct SonKuRoomGeometry { + float widthMeters=7.2f,depthMeters=7.2f,distanceMeters=1.6f; +}; class SonKuEarlyReflections final { public: struct Ears {float left=0.f,right=0.f;}; @@ -54,10 +60,39 @@ class SonKuEarlyReflections final { return false; if(active())return false; shape_=shape; + custom_=false; // restores the exact legacy square/rectangle semantics + untilGeometry_=0; + primed_=false; + return true; + } + // Evaluated on an unpublished, inactive DSP instance only. Width up to + // 40m is safely contained in the existing 8192-frame delay rings at 48k. + static bool validGeometry(const SonKuRoomGeometry& g) noexcept { + if(!std::isfinite(g.widthMeters)||!std::isfinite(g.depthMeters)|| + !std::isfinite(g.distanceMeters))return false; + if(g.widthMeters<5.f||g.depthMeters<5.f|| + g.widthMeters>40.f||g.depthMeters>40.f|| + g.distanceMeters<1.6f||g.distanceMeters>10.f|| + 2.f*(g.distanceMeters+.5f)>std::min(g.widthMeters,g.depthMeters)) + return false; + const float longest=std::max(g.widthMeters,g.depthMeters)+g.distanceMeters; + const float largestPath=std::sqrt(longest*longest+ + g.distanceMeters*g.distanceMeters); + return (largestPath-g.distanceMeters)*48000.f/343.f+32.f < + static_cast(ringFrames-3); + } + bool setGeometry(const SonKuRoomGeometry& g) noexcept { + if(active()||!validGeometry(g))return false; + geometry_=g; + custom_=true; + shape_=SonKuRoomShape::Square; // consistent 0.70 walls, not rectangle untilGeometry_=0; primed_=false; return true; } + float relativeDistanceGain() const noexcept { + return custom_?1.6f/geometry_.distanceMeters:1.f; + } SonKuRoomShape shape() const noexcept {return shape_;} bool active() const noexcept {return ready_&&(amount_>0.f||amountTarget_>0.f);} float targetAmount() const noexcept {return amountTarget_;} @@ -116,11 +151,13 @@ class SonKuEarlyReflections final { } void updateGeometry(double azimuth,float spread) noexcept { constexpr float pi=3.14159265358979323846f; - constexpr float sourceDistance=1.60f; // meters - // The square profile tests rotationally symmetric wall geometry; - // it is not a simulated circular room or guaranteed psychoacoustics. - const float halfWidth=(shape_==SonKuRoomShape::Square)?3.60f:3.20f; - const float halfDepth=(shape_==SonKuRoomShape::Square)?3.60f:4.00f; + const float sourceDistance=custom_?geometry_.distanceMeters:1.60f; + // Preserve the approved 7.2m/1.6m path exactly when custom_ is false. + // A wider room changes physical image paths, not KEMAR azimuth signs. + const float halfWidth=custom_?geometry_.widthMeters*.5f: + ((shape_==SonKuRoomShape::Square)?3.60f:3.20f); + const float halfDepth=custom_?geometry_.depthMeters*.5f: + ((shape_==SonKuRoomShape::Square)?3.60f:4.00f); constexpr float speedOfSound=343.f; constexpr float earHalfTime=.00031f; // max +/-0.31ms constexpr std::array rectangular{.74f,.74f,.67f,.67f}; @@ -145,7 +182,11 @@ class SonKuEarlyReflections final { // symmetric while keeping every reflection causal. const float common=extra+earHalfTime*rate_; const float earDelta=directionX*earHalfTime*rate_; - const float level=.28f*walls[wall]*(sourceDistance/path); + // New distance studies use fixed 1.6m acoustic reference: + // pressure at a reflected path falls with 1/path. Legacy + // calculations are untouched at the accepted radius. + const float level=.28f*walls[wall]* + ((custom_?1.6f:sourceDistance)/path); auto& tap=tap_[source][wall]; tap.targetDelayL=std::clamp(common+earDelta,1.f, static_cast(ringFrames-3)); @@ -171,6 +212,7 @@ class SonKuEarlyReflections final { float amount_=0.f,amountTarget_=0.f; int write_=0,untilGeometry_=0; SonKuRoomShape shape_=SonKuRoomShape::Rectangular; - bool ready_=false,primed_=false; + SonKuRoomGeometry geometry_{}; + bool custom_=false,ready_=false,primed_=false; }; } // namespace armix::sonku From 76e086af8624a8ed15b4929fadea8f22fe7688d1 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 13 Nov 2026 13:11:35 +0700 Subject: [PATCH 2/8] feat(sonku): offline bounded room geometry and inverse-distance binaural cues --- engine/builtin_fx/sonku/SonKuSpatialCore.h | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/engine/builtin_fx/sonku/SonKuSpatialCore.h b/engine/builtin_fx/sonku/SonKuSpatialCore.h index 557c0d1ef..6f0073ac0 100644 --- a/engine/builtin_fx/sonku/SonKuSpatialCore.h +++ b/engine/builtin_fx/sonku/SonKuSpatialCore.h @@ -89,6 +89,10 @@ class SonKuSpatialCore final { bool setEarlyReflectionsShape(SonKuRoomShape shape) noexcept { return room_.setShape(shape); } + // Offline M3 distance/large-room acoustic trial. Not a GUI/native ABI. + bool setAcousticRoomGeometry(const SonKuRoomGeometry& geometry) noexcept { + return room_.setGeometry(geometry); + } // Experimental wet-only late room, OFF unless explicitly enabled by // controlled offline A/B. The native parameter contract is unchanged. bool setMusicalReverbAmount(float amount) noexcept { @@ -105,6 +109,7 @@ class SonKuSpatialCore final { if(!ready_ || !left || !right || samples<=0)return; const double step=(settings_.moving ? (settings_.clockwise?1.:-1.)*360./(sampleRate_*settings_.revolutionSeconds) : 0.); + const float distanceGain=room_.relativeDistanceGain(); for(int i=0;i Date: Fri, 13 Nov 2026 13:11:38 +0700 Subject: [PATCH 3/8] test(sonku): protect approved square and validate room/distance PCM --- tests/sonku_early_reflections_test.cpp | 41 ++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/tests/sonku_early_reflections_test.cpp b/tests/sonku_early_reflections_test.cpp index 9d5787030..a540ca5eb 100644 --- a/tests/sonku_early_reflections_test.cpp +++ b/tests/sonku_early_reflections_test.cpp @@ -10,6 +10,7 @@ int main(){ using armix::sonku::SonKuEarlyReflections; using armix::sonku::SonKuRoomShape; + using armix::sonku::SonKuRoomGeometry; SonKuEarlyReflections invalid; assert(!invalid.prepare(96000.)); assert(!invalid.prepare(std::numeric_limits::quiet_NaN())); @@ -30,6 +31,46 @@ int main(){ } assert(soundEnergy>.004); assert(mirrorError<1.e-4); + // The published user's approved square impulse must remain byte-exact + // when the same geometry is expressed explicitly. + { + SonKuEarlyReflections approved,explicitSquare; + assert(approved.prepare(rate)&&explicitSquare.prepare(rate)); + assert(approved.setShape(SonKuRoomShape::Square)); + assert(explicitSquare.setGeometry({7.2f,7.2f,1.6f})); + assert(approved.setAmount(.55f)&&explicitSquare.setAmount(.55f)); + assert(!explicitSquare.setGeometry({14.4f,14.4f,5.f})); + for(int i=0;i<8192;++i) { + const float v=i==0?.75f:0.f; + const auto a0=approved.process(v,v,37.,45.f); + const auto b0=explicitSquare.process(v,v,37.,45.f); + assert(a0.left==b0.left&&a0.right==b0.right); + } + } + assert(!SonKuEarlyReflections::validGeometry({7.2f,7.2f,5.f})); + assert(!SonKuEarlyReflections::validGeometry({40.1f,40.f,1.6f})); + assert(!SonKuEarlyReflections::validGeometry({ + std::numeric_limits::quiet_NaN(),14.f,2.f})); + assert(SonKuEarlyReflections::validGeometry({14.4f,14.4f,5.f})); + assert(SonKuEarlyReflections::validGeometry({28.8f,28.8f,8.f})); + // Larger boundaries delay the FIRST reflected arrival. No longer + // room is faked by increasing a single reverb decay number. + { + SonKuEarlyReflections nearRoom,largeRoom; + assert(nearRoom.prepare(rate)&&largeRoom.prepare(rate)); + assert(nearRoom.setShape(SonKuRoomShape::Square)); + assert(largeRoom.setGeometry({28.8f,28.8f,1.6f})); + assert(nearRoom.setAmount(.55f)&&largeRoom.setAmount(.55f)); + int nearFirst=-1,largeFirst=-1; + for(int i=0;i<8000;++i) { + const float v=i==0?1.f:0.f; + const auto a0=nearRoom.process(v,v,0.,0.f); + const auto b0=largeRoom.process(v,v,0.,0.f); + if(nearFirst<0 && (a0.left!=0.f||a0.right!=0.f))nearFirst=i; + if(largeFirst<0 && (b0.left!=0.f||b0.right!=0.f))largeFirst=i; + } + assert(nearFirst>100 && largeFirst>nearFirst+800); + } SonKuEarlyReflections a,b; assert(a.prepare(rate)&&b.prepare(rate)); assert(!a.active()); From 336afbba2107388cd4cea2ea6be7408209d0a653 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 13 Nov 2026 13:11:40 +0700 Subject: [PATCH 4/8] test(sonku): protect approved square and validate room/distance PCM --- tests/sonku_spatial_core_test.cpp | 39 +++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/tests/sonku_spatial_core_test.cpp b/tests/sonku_spatial_core_test.cpp index 12689ec53..b48a83257 100644 --- a/tests/sonku_spatial_core_test.cpp +++ b/tests/sonku_spatial_core_test.cpp @@ -154,6 +154,45 @@ int main() { std::abs(tailR[i]-squareR[i]); } assert(lateDifference>.001); + // Explicit approved square parameters remain PCM-identical. Radius + // attenuation works even with early reflections disabled, so SPACE + // and DISTANCE remain independent, not one misleading "big hall" knob. + { + auto approved=std::make_unique(); + auto same=std::make_unique(); + auto distant=std::make_unique(); + assert(approved->prepare(rate)&&same->prepare(rate)&& + distant->prepare(rate)); + Settings pose=s;pose.moving=false;pose.startAzimuthDegrees=0.f; + assert(approved->setSettings(pose)&&same->setSettings(pose)&& + distant->setSettings(pose)); + assert(approved->setEarlyReflectionsShape(SonKuRoomShape::Square)); + assert(same->setAcousticRoomGeometry({7.2f,7.2f,1.6f})); + assert(distant->setAcousticRoomGeometry({28.8f,28.8f,8.f})); + assert(approved->setEarlyReflectionsAmount(.55f)); + assert(same->setEarlyReflectionsAmount(.55f)); + std::array aa{},ab{},ba{},bb{}; + aa[0]=ab[0]=ba[0]=bb[0]=.6f; + approved->process(aa.data(),ab.data(),4096); + same->process(ba.data(),bb.data(),4096); + for(int i=0;i<4096;++i) { + assert(aa[i]==ba[i]&&ab[i]==bb[i]); + } + std::array nearL{},nearR{},farL{},farR{}; + nearL[0]=nearR[0]=farL[0]=farR[0]=.6f; + // Compare separate fresh reference to distant field (ER OFF). + auto dryNear=std::make_unique(); + assert(dryNear->prepare(rate)&&dryNear->setSettings(pose)); + dryNear->process(nearL.data(),nearR.data(),1024); + distant->process(farL.data(),farR.data(),1024); + double nearEnergy=0.,farEnergy=0.; + for(int i=0;i<1024;++i) { + nearEnergy+=std::abs(nearL[i])+std::abs(nearR[i]); + farEnergy+=std::abs(farL[i])+std::abs(farR[i]); + } + assert(nearEnergy>.01); + assert(std::abs(farEnergy/nearEnergy-.2)<1.e-5); + } // A hard FRONT->REAR teleport must not replace 560 FIR coefficients // at the next 16-sample boundary. Compare the identical dry/PCM // history before and immediately after reposition. From a020baf80aba3800053e31562a1c7d876e845369 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 13 Nov 2026 13:13:04 +0700 Subject: [PATCH 5/8] feat(sonku): deterministic larger room and distant-source listening WAVs --- tools/sonku_offline_listening.cpp | 44 ++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/tools/sonku_offline_listening.cpp b/tools/sonku_offline_listening.cpp index 548ceeb1b..08b579f96 100644 --- a/tools/sonku_offline_listening.cpp +++ b/tools/sonku_offline_listening.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -106,10 +107,12 @@ std::vector orbit(float roomAmount=0.f, armix::sonku::SonKuRoomShape shape=armix::sonku::SonKuRoomShape::Rectangular, bool clockwise=true,float lateAmount=0.f, armix::sonku::SonKuReverbPreset latePreset= - armix::sonku::SonKuReverbPreset::StudioGlue){ + armix::sonku::SonKuReverbPreset::StudioGlue, + std::optional geometry=std::nullopt){ SonKuSpatialCore dsp;Noise noise; if(!dsp.prepare(rate))throw std::runtime_error("No 48k HRTF"); if(!dsp.setEarlyReflectionsShape(shape)|| + (geometry && !dsp.setAcousticRoomGeometry(*geometry))|| !dsp.setMusicalReverbPreset(latePreset)|| !dsp.setEarlyReflectionsAmount(roomAmount)|| !dsp.setMusicalReverbAmount(lateAmount)) @@ -239,8 +242,22 @@ void notes(const std::filesystem::path& directory, <<"The plucks are ORIGINAL test tones (no copyrighted composition).\n" <<"Use them to judge vocal-like reverb coloration/tail musicality.\n" <<"Both comparisons reuse exactly the same source noise and direct HRIR.\n" - <<"Do blind-level and externalization evaluation before enabling V2 live.\n" - <<"This is NOT full HRIR-convolved reflections, FDN or personalized HRTF.\n"; + <<"V4: DISTANCE and ROOM SIZE are separate acoustic parameters.\n" + <<"sonku-v4-spacious-near-orbit-cw-2x.wav = 14.4x14.4m at 1.6m.\n" + <<"sonku-v4-spacious-far-orbit-cw-2x.wav = 14.4x14.4m at 5.0m.\n" + <<"sonku-v4-large-near-orbit-cw-2x.wav = 28.8x28.8m at 1.6m.\n" + <<"sonku-v4-large-far-orbit-cw-2x.wav = 28.8x28.8m at 8.0m.\n" + <<"All V4 tracks use the SAME 20s source and orbital motion as Square.\n" + <<"Larger room = later/weaker true 1st-order image echoes.\n" + <<"More distant source = quieter 1/r DIRECT KEMAR and weaker echoes.\n" + <<"These WAVs are NOT peak-normalized: turn down before near tracks.\n" + <<"Use matched perceived playback loudness for judgments of spatial\n" + <<"distance, and separately judge actual level reduction as a cue.\n" + <<"V4 room tests disable FDN deliberately: the existing 0.78/1.28s\n" + <<"tail is not calibrated for large halls (no pretend big-hall RT60).\n" + <<"Not simulated: air absorption, floor/ceiling, personalized HRTF,\n" + <<"direct path time-of-flight, or higher-order wall reflections.\n" + <<"Offline candidates only, NO native GUI/session/product release.\n"; std::ofstream key(directory/"BLIND-ANSWER-KEY.txt"); if(!key)throw std::runtime_error("Cannot write blind answer key"); key<<"OPEN ONLY AFTER LISTENING. Exact 2.5-second trial windows:\n"; @@ -285,6 +302,27 @@ int main(int argc,char** argv){ musicalOrbit(.42f,armix::sonku::SonKuReverbPreset::StudioGlue)); writeWav(dir/"sonku-musical-square-airy-2x.wav", musicalOrbit(.42f,armix::sonku::SonKuReverbPreset::AiryChamber)); + // V4 independent distance/room dimensions, not synthetic reverb EQ. + // Original approved Square WAV and all V1-V3 audio are unchanged. + using armix::sonku::SonKuRoomShape; + using armix::sonku::SonKuRoomGeometry; + using armix::sonku::SonKuReverbPreset; + writeWav(dir/"sonku-v4-spacious-near-orbit-cw-2x.wav", + orbit(.55f,SonKuRoomShape::Square,true,0.f, + SonKuReverbPreset::StudioGlue, + SonKuRoomGeometry{14.4f,14.4f,1.6f})); + writeWav(dir/"sonku-v4-spacious-far-orbit-cw-2x.wav", + orbit(.55f,SonKuRoomShape::Square,true,0.f, + SonKuReverbPreset::StudioGlue, + SonKuRoomGeometry{14.4f,14.4f,5.f})); + writeWav(dir/"sonku-v4-large-near-orbit-cw-2x.wav", + orbit(.55f,SonKuRoomShape::Square,true,0.f, + SonKuReverbPreset::StudioGlue, + SonKuRoomGeometry{28.8f,28.8f,1.6f})); + writeWav(dir/"sonku-v4-large-far-orbit-cw-2x.wav", + orbit(.55f,SonKuRoomShape::Square,true,0.f, + SonKuReverbPreset::StudioGlue, + SonKuRoomGeometry{28.8f,28.8f,8.f})); notes(dir,blind); std::cout<<"SonKu listening package PASS: measured native HRTF, " <<"4 labeled + 8 blind directions + two uninterrupted 360 turns\n"; From f8b7320bd3fc8e0f4f1e9df7cf81b5f9cad40bd4 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 13 Nov 2026 13:13:06 +0700 Subject: [PATCH 6/8] test(sonku): verify distance and room dimensions in WAV contracts --- tests/sonku_offline_demo_contract.py | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/tests/sonku_offline_demo_contract.py b/tests/sonku_offline_demo_contract.py index dde0b43f6..7a9bb4842 100644 --- a/tests/sonku_offline_demo_contract.py +++ b/tests/sonku_offline_demo_contract.py @@ -6,7 +6,7 @@ import wave root = Path(sys.argv[1] if len(sys.argv)>1 else "sonku-listening") -def read(name, frames): +def read(name, frames, minimum_peak=250, minimum_energy=100000): path=root/name assert path.exists() and path.stat().st_size>10000,path with wave.open(str(path),"rb") as w: @@ -18,8 +18,8 @@ def read(name, frames): if sys.byteorder!="little":pcm.byteswap() assert len(pcm)==2*frames peak=max(map(abs,pcm)) - assert 250100000,(name,"unexpected silence") + assert minimum_peakminimum_energy,(name,"unexpected silence") return pcm single=read("sonku-reference-four.wav",4*120000) blind=read("sonku-blind-eight.wav",8*120000) @@ -35,6 +35,22 @@ def read(name, frames): musicBase=read("sonku-musical-square-base-2x.wav",960000) musicGlue=read("sonku-musical-square-glue-2x.wav",960000) musicAiry=read("sonku-musical-square-airy-2x.wav",960000) +spaciousNear=read("sonku-v4-spacious-near-orbit-cw-2x.wav",960000) +spaciousFar=read("sonku-v4-spacious-far-orbit-cw-2x.wav",960000,60,10000) +largeNear=read("sonku-v4-large-near-orbit-cw-2x.wav",960000) +largeFar=read("sonku-v4-large-far-orbit-cw-2x.wav",960000,40,8000) +# Same source and identical 20s orbital clock: room width only changes +# path delay/level; source distance only changes geometric pressure. +def pcm_delta(a,b): + return sum(abs(int(x)-int(y)) for x,y in zip(a[300000:440000],b[300000:440000])) +assert pcm_delta(spaciousNear,squareOrbit)>1500,"Spacious room is identical to approved square" +assert pcm_delta(largeNear,spaciousNear)>1500,"Large and spacious room are identical" +assert pcm_delta(spaciousFar,spaciousNear)>1500,"5m source ignored" +assert pcm_delta(largeFar,largeNear)>1500,"8m source ignored" +def energy(a): + return sum(abs(int(x)) for x in a[300000:440000]) +assert .081000 # Verify there is no mute, edit or source reset at the 10s handoff. # Stereo interleaved: 48000 samples = 1 second, 2 PCM ints per frame. -for audio in (orbit,v2orbit,squareOrbit,reverse,reverseRoom,reverseSquare,glue,airy): +for audio in (orbit,v2orbit,squareOrbit,reverse,reverseRoom,reverseSquare, + glue,airy,spaciousNear,spaciousFar,largeNear,largeFar): for second in (9,10,11,19): begin=(second*48000+4000)*2 - assert sum(abs(x) for x in audio[begin:begin+9600])>2000,( + assert sum(abs(x) for x in audio[begin:begin+9600])>400,( "silent loop seam",second) assert "20s" in (root/"LISTENING-GUIDE.txt").read_text() assert not (root/"sonku-orbit-cw.wav").exists(),( From 64c8357f67c98f1aff1896a80182a6b3261c3ec8 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 13 Nov 2026 13:13:09 +0700 Subject: [PATCH 7/8] feat(sonku): deterministic larger room and distant-source listening WAVs --- tools/sonku_rt_benchmark.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/sonku_rt_benchmark.cpp b/tools/sonku_rt_benchmark.cpp index 3336e5749..b3e359e49 100644 --- a/tools/sonku_rt_benchmark.cpp +++ b/tools/sonku_rt_benchmark.cpp @@ -13,13 +13,16 @@ namespace { struct Result {double milliseconds=0.,checksum=0.,audios=0.;}; template -Result measure(double rate,float amount,float late=0.f){ +Result measure(double rate,float amount,float late=0.f, + const armix::sonku::SonKuRoomGeometry* geometry=nullptr){ using namespace armix::sonku; SonKuSpatialCore dsp; if(!dsp.prepare(rate))throw std::runtime_error("unsupported sample rate"); Settings s{};s.moving=true;s.revolutionSeconds=10.f; s.spatialMix=1.f;s.stereoSpreadDegrees=60.f; - if(!dsp.setSettings(s)||!dsp.setEarlyReflectionsAmount(amount)|| + if(!dsp.setSettings(s)|| + (geometry && !dsp.setAcousticRoomGeometry(*geometry))|| + !dsp.setEarlyReflectionsAmount(amount)|| !dsp.setMusicalReverbAmount(late)) throw std::runtime_error("invalid DSP setup"); std::array inputL{},inputR{}; @@ -52,11 +55,14 @@ void report(double rate){ const auto baseline=measure(rate,0.f); const auto room=measure(rate,.55f); const auto musical=measure(rate,.55f,.42f); + const armix::sonku::SonKuRoomGeometry large{28.8f,28.8f,8.f}; + const auto space=measure(rate,.55f,0.f,&large); std::cout<0.5 m wall clearance and worst image + path within the existing 8192-frame circular delay ring at 48 kHz. +- First-order image-source paths still use 2 emitters × 4 walls, 64-frame + geometry cadence, fractional-delay taps, smoothed delays and gains. No ray + tracing, FFT, new thread, host callback, heap or IO in `process()`. +- `SonKuSpatialCore` applies reference-distance gain ONLY to direct measured + HRTF when an experimental non-reference geometry is configured; reflections + use absolute reflected path pressure and the existing FDN stage is unchanged. +- This is NOT a full physical BRIR: no floor/ceiling, higher-order reflections, + occlusion, calibrated high-frequency air absorption, direct time-of-flight, + personalized pinna model, dynamic head tracking or release-qualified tail. +- No GUI/bridge/lease/session edits; ALL production instances remain legacy + geometry with direct gain=1 and the approved PCM arithmetic unchanged. + +## Matched-source audition matrix (two 10-second 360° revolutions) +The existing `sonku-v2-square-orbit-cw-2x.wav` remains the reference. + +| WAV stem | Width × depth | Emission radius | Late reverb | Intended comparison | +| --- | --- | --- | --- | --- | +| v2-square | 7.2 × 7.2 m | 1.6 m | OFF | Owner-approved | +| v4-spacious-near | 14.4 × 14.4 m | 1.6 m | OFF | Room dimension only | +| v4-spacious-far | 14.4 × 14.4 m | 5.0 m | OFF | Distance only vs spacious-near | +| v4-large-near | 28.8 × 28.8 m | 1.6 m | OFF | Larger room without moving source | +| v4-large-far | 28.8 × 28.8 m | 8.0 m | OFF | Distance only vs large-near | + +All render the same deterministic noise, source stereo, azimuth path, +KEMAR HRIR, wet setting and trim. Files are NOT normalized: distant samples +are truly quieter. For localization evaluation match perceived monitoring +loudness safely and separately evaluate the physical level change. +Headphones only; disable OS spatial enhancement. + +## Gates +1. Legacy default Square vs explicit identical geometry: byte-exact early + reflection and full native-core PCM under both 44.1/48k. +2. Larger room first-echo onset must move later, beyond the reference. +3. Distant direct field must approximate 1.6/r with ER OFF; reject invalid, + nonfinite, too-small, out-of-wall geometry and active edits. +4. Complete WAV formats, continuous 2-turn seam, non-silent tails, + direction signs, parity, amplitude safety and same-runner CPU telemetry. +5. Listener A/B judgment and Windows ASIO hardware tests are separate, + necessary release gates. No native GUI control or installer promotion yet. + +## Research +- Allen and Berkley, JASA 65(4), 943–950 (1979), DOI 10.1121/1.382599: + first-order image-source paths for rectangular rooms. +- Valve Steam Audio core guide, direct distance attenuation and reflection + model as separate signal-processing stages: + https://github.com/ValveSoftware/steam-audio/blob/master/core/doc/guide.rst + +No external code or proprietary impulse responses copied.