Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
279 changes: 279 additions & 0 deletions .github/workflows/sonku-p86-windows-field.yml

Large diffs are not rendered by default.

54 changes: 53 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ if(ARMIX_SONKU_EXPERIMENTAL_P85_NATIVE_RT AND
NOT ARMIX_SONKU_EXPERIMENTAL_P84_NATIVE_RT)
message(FATAL_ERROR "P8.5 requires P8.4 native fusion research; production stays OFF")
endif()
# Isolated post-FAT P8.6 horizontal speaker focus. OFF in production.
option(ARMIX_SONKU_EXPERIMENTAL_P86_NATIVE_RT
"Opt-in P8.6 horizontal speaker focus while keeping golden 0/3/4" OFF)
if(ARMIX_SONKU_EXPERIMENTAL_P86_NATIVE_RT AND
NOT ARMIX_SONKU_EXPERIMENTAL_P85_NATIVE_RT)
message(FATAL_ERROR "P8.6 focus requires P8.5 coherent-world research")
endif()
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

Expand Down Expand Up @@ -266,7 +273,9 @@ target_compile_definitions(ARMixConsole PRIVATE
$<$<BOOL:${ARMIX_SONKU_EXPERIMENTAL_P84_NATIVE_RT}>:ARMIX_SONKU_EXPERIMENTAL_P84_NATIVE_RT=1>
$<$<BOOL:${ARMIX_SONKU_EXPERIMENTAL_P84_NATIVE_RT}>:SONKU_P84_SINGLE_CORE_FUSION_RESEARCH=1>
$<$<BOOL:${ARMIX_SONKU_EXPERIMENTAL_P85_NATIVE_RT}>:ARMIX_SONKU_EXPERIMENTAL_P85_NATIVE_RT=1>
$<$<BOOL:${ARMIX_SONKU_EXPERIMENTAL_P85_NATIVE_RT}>:SONKU_P85_WORLD_COHERENCE_RESEARCH=1>)
$<$<BOOL:${ARMIX_SONKU_EXPERIMENTAL_P85_NATIVE_RT}>:SONKU_P85_WORLD_COHERENCE_RESEARCH=1>
$<$<BOOL:${ARMIX_SONKU_EXPERIMENTAL_P86_NATIVE_RT}>:ARMIX_SONKU_EXPERIMENTAL_P86_NATIVE_RT=1>
$<$<BOOL:${ARMIX_SONKU_EXPERIMENTAL_P86_NATIVE_RT}>:SONKU_P86_HORIZONTAL_FOCUS_RESEARCH=1>)
if(WIN32)
# Windows retains its proven ASIO-first / WASAPI / static WebView2 distribution.
# Never link Windows loader or sound APIs into macOS/Linux builds.
Expand Down Expand Up @@ -540,6 +549,49 @@ if(BUILD_TESTING)
SONKU_P85_WORLD_COHERENCE_RESEARCH=1)
add_test(NAME NativeSonKuP85JuceV6AudioAckLegacySafeRestore
COMMAND ARMixSonKuP85NativeTests)
if(ARMIX_SONKU_EXPERIMENTAL_P86_NATIVE_RT)
add_executable(ARMixSonKuP86FocusSourceTests
tests/sonku_p86_horizontal_focus_native_source_test.cpp)
target_compile_features(ARMixSonKuP86FocusSourceTests PRIVATE cxx_std_20)
target_compile_definitions(ARMixSonKuP86FocusSourceTests PRIVATE
SONKU_P7_MEASURED_ELEVATION_RESEARCH=1
SONKU_P71_DIRECT_XYZ_RESEARCH=1
SONKU_P72_NATIVE_XYZ_RT=1
SONKU_P75_MUSIC_SAFE_RESEARCH=1
SONKU_P80_TRANSPARENT_BASS_RESEARCH=1
SONKU_P82_MULTIBAND_ROOM_RESEARCH=1
SONKU_P83_PHYSICAL_SPEAKER_RESEARCH=1
SONKU_P84_SINGLE_CORE_FUSION_RESEARCH=1
SONKU_P85_WORLD_COHERENCE_RESEARCH=1
SONKU_P86_HORIZONTAL_FOCUS_RESEARCH=1)
add_test(NAME NativeSonKuP86SixWallHorizontalFocusAndMusicIntegrity
COMMAND ARMixSonKuP86FocusSourceTests)
juce_add_console_app(ARMixSonKuP86NativeTests
PRODUCT_NAME "ArSonMix SonKu P86 Native JUCE v7 Tests")
target_sources(ARMixSonKuP86NativeTests PRIVATE
tests/sonku_p86_native_juce_v7_test.cpp)
target_compile_features(ARMixSonKuP86NativeTests PRIVATE cxx_std_20)
target_link_libraries(ARMixSonKuP86NativeTests PRIVATE
juce::juce_audio_processors juce::juce_recommended_config_flags)
target_compile_definitions(ARMixSonKuP86NativeTests PRIVATE
ARMIX_SONKU_EXPERIMENTAL_NATIVE_XYZ_RT=1
ARMIX_SONKU_EXPERIMENTAL_P83_NATIVE_RT=1
ARMIX_SONKU_EXPERIMENTAL_P84_NATIVE_RT=1
ARMIX_SONKU_EXPERIMENTAL_P85_NATIVE_RT=1
ARMIX_SONKU_EXPERIMENTAL_P86_NATIVE_RT=1
SONKU_P7_MEASURED_ELEVATION_RESEARCH=1
SONKU_P71_DIRECT_XYZ_RESEARCH=1
SONKU_P72_NATIVE_XYZ_RT=1
SONKU_P75_MUSIC_SAFE_RESEARCH=1
SONKU_P80_TRANSPARENT_BASS_RESEARCH=1
SONKU_P82_MULTIBAND_ROOM_RESEARCH=1
SONKU_P83_PHYSICAL_SPEAKER_RESEARCH=1
SONKU_P84_SINGLE_CORE_FUSION_RESEARCH=1
SONKU_P85_WORLD_COHERENCE_RESEARCH=1
SONKU_P86_HORIZONTAL_FOCUS_RESEARCH=1)
add_test(NAME NativeSonKuP86JuceV7AudioAckAndV6Restore
COMMAND ARMixSonKuP86NativeTests)
endif()
endif()
endif()
endif()
Expand Down
32 changes: 32 additions & 0 deletions docs/SONKU_P86_HORIZONTAL_SPEAKER_FOCUS_20261115.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# SonKu P8.6 — Horizontal Speaker Focus (private FAT candidate, NOT released)

## Owner headphone FAT → measurable hypothesis

P8.5 Windows portable (sha `121fcc514c660327e29054c32266d2ed5ba54600`, Actions `43659462670`) creates **slight genuine perceived externalization**. Compared with dearVR PRO2, however, music feels too large and diffuse, as if speakers fill floor and ceiling instead of being identifiable ear-height virtual loudspeakers that can rotate around the listener. Preserve P8.5 as the newest physically preferred baseline, P8.4 as musical reference, P8.2 as fallback. **P8.3 remains rejected**.

The source-backed difference is not that the HRIR direct source has an unexpected positive elevation (owner tested 0°). Rather, when ROOM is enabled, P8.5 renders six material-coloured measured reflection paths, including ceiling and floor, plus a diffuse eight-line FDN. The scene applies separate gain laws `1.45+2*reflection` and `2.2+4*ambience` to these fields. At LARGE / reflections 100% / reverb 47%, such a large diffuse room can mask the directional direct image. This is an acoustic **hypothesis consistent with the report**, not a proof of perceived causality. The HEAD frame yaw mismatch was already fixed in P8.5. Stereo SIDE still remains partially head-locked and generic KEMAR/headphone compensation can create unrelated localization errors.

Sennheiser says dearVR's CLARITY tunes the spatialization–timbre trade-off for different sound material; its proprietary method is not copied: https://help.sennheiser.com/hc/en-us/articles/27424692616594-How-to-produce-natural-immersive-music-with-the-CLARITY-modul-of-dearVR-PRO2. Relevant review of directional, reverberant and head-motion cues: https://www.frontiersin.org/journals/psychology/articles/10.3389/fpsyg.2024.1408073/full and https://www.frontiersin.org/journals/neuroscience/articles/10.3389/fnins.2023.1027827/full .

## P8.6 algorithm and isolation

Use new research-only mode `renderMode=5` with `ARMIX_SONKU_EXPERIMENTAL_P86_NATIVE_RT=ON` and `SONKU_P86_HORIZONTAL_FOCUS_RESEARCH=1`. Production default OFF; no change to old modes 0/3/4 or user's scene/preset. In mode 5 only:

- Keep **exact P8.5 direct two fused HRIRs**, head yaw world→head, music SIDE, preserved original bass/crossover, tonality, output gain, limiter, PCM engine and convolution. Do **not** increase speaker contrast or invent crossfeed/phase shifts.
- The native six-wall room still processes all six paths and uses their original geometry, delay, HRTF coefficients, RT60 material and IACC cues. Four horizontal walls remain **100%** of their existing path response. Floor path is **24%**, ceiling path **15%** of P8.5 reflection pressure; neither is hard-muted. This specifically reduces *up/down* phantom energy without setting direct elevation to an artificial value.
- Independently lower the P8.5 **ER presence coefficient to 76%** and diffuse **late presence to 38%**. Keep both wet components separately audible, retaining room identity and distance. No EQ, limiter makeup, automatic loudness shift, extra FIR, additional audio callback, heap, locks, or new codec.
- Native v7 retains identical 59-byte state structure. Prior v1-v6 states load with old mode 0/3/4 intact. Reject P8.3 modes (1/2) in bridge and v7 state. GUI editor exposes P8.2 / P8.4 / P8.5 / P8.6 only after identity-matched native v7 capability/readback. No preset reset in A/B.

Quantitative coefficients are **research starting points**, not optimized by ear or claimed equivalent to dearVR. Do not ship a GUI preset with forced reflections 100%, or silently rewrite any existing user state.

## Required gates

1. Source-native C++: P8.6 ROOM OFF must be bit-exact P8.5 at 44.1/48k, yaw 0/60/180, azimuth 0/90/180, correlated and anti-phase material, and 64/128 sample blocks.
2. Source-native isolated per-wall PCM impulse test: four horizontal walls P8.6/P8.5 energy = 1.000 each; floor = 0.24² = 0.0576; ceiling = 0.15² = 0.0225, and both nonzero. ROOM ON measured PCM difference and preserved finite output.
3. JUCE v7: queued audio-side mode change, accurate applied ACK, state save/restore, old v6 P8.5 recovery, disallow 1/2, device prepare, FX bypass, and native host unchanged.
4. Windows real executable, approved embedded GUI resources, source SHA and signed PE architecture, portable ZIP, CTests and exact run artifact; **not** approved on Linux only.
5. Perceptual FAT cannot be replaced by PCM directionality. On the same headphone/song and matched measured level, compare P8.5 vs P8.6 at yaw 0, ±30/60/90/180 with STATIC, 60° spread, 1.6–3m ROOM OFF/ON first, then owner LARGE/100%/47%, including intentional FRONT/LEFT/REAR/RIGHT. Rate ear-height source pinpoint accuracy, separation, music body, bass, vocal, fatigue and width. If P8.6 is too dry/internal or weak, P8.5 wins. Retain immediate A/B rollback.

## Known limitations / non-goals

No real head tracking from manual yaw. No personalized HRIR/headphone correction or measured BRIR. High music SIDE remains partly headphone-head-locked. Room reductions may improve directional prominence yet reduce natural externalization; this is why source-only CI does not establish success. No merge to main, no public release and no claim of dearVR parity before FAT. The branch is a quarantined stack on P8.5 research; after approved FAT, extract a clean production-safe patch without rejected P8.3 code ancestry.
16 changes: 16 additions & 0 deletions engine/builtin_fx/SonKuSpatialProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,11 @@ class SonKuSpatialProcessor final : public juce::AudioProcessor,
#if defined(ARMIX_SONKU_EXPERIMENTAL_P83_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P83_NATIVE_RT
#if defined(ARMIX_SONKU_EXPERIMENTAL_P84_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P84_NATIVE_RT
#if defined(ARMIX_SONKU_EXPERIMENTAL_P85_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P85_NATIVE_RT
#if defined(ARMIX_SONKU_EXPERIMENTAL_P86_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P86_NATIVE_RT
out.writeInt(7); // 59-byte layout; mode 5, old sessions intact
#else
out.writeInt(6); // unchanged 59-byte state; P8.5 is opt-in mode 4
#endif
#else
out.writeInt(5); // same 59-byte layout as v4, new P8.4 mode
#endif
Expand Down Expand Up @@ -216,6 +220,9 @@ class SonKuSpatialProcessor final : public juce::AudioProcessor,
&&version!=5
#if defined(ARMIX_SONKU_EXPERIMENTAL_P85_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P85_NATIVE_RT
&&version!=6
#if defined(ARMIX_SONKU_EXPERIMENTAL_P86_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P86_NATIVE_RT
&&version!=7
#endif
#endif
#endif
#endif
Expand All @@ -229,6 +236,9 @@ class SonKuSpatialProcessor final : public juce::AudioProcessor,
||(version==5&&size!=59)
#if defined(ARMIX_SONKU_EXPERIMENTAL_P85_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P85_NATIVE_RT
||(version==6&&size!=59)
#if defined(ARMIX_SONKU_EXPERIMENTAL_P86_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P86_NATIVE_RT
||(version==7&&size!=59)
#endif
#endif
#endif
#endif
Expand Down Expand Up @@ -288,6 +298,12 @@ class SonKuSpatialProcessor final : public juce::AudioProcessor,
if(version==6 && next.renderMode!=0 && next.renderMode!=3 && next.renderMode!=4)
return false;
if(version==6 && next.musicCompatibleLowFrequency)return false;
#if defined(ARMIX_SONKU_EXPERIMENTAL_P86_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P86_NATIVE_RT
// P8.6 mode 5 is opt-in only. v6 mode 4 is never migrated.
if(version==7 && next.renderMode!=0 && next.renderMode!=3 &&
next.renderMode!=4 && next.renderMode!=5)return false;
if(version==7 && next.musicCompatibleLowFrequency)return false;
#endif
#endif
#endif
}
Expand Down
25 changes: 20 additions & 5 deletions engine/builtin_fx/sonku/SonKuEarlyReflections.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ class SonKuEarlyReflections final {
#endif
}
Ears process(float left,float right,double azimuth,float spread,
float headYawDegrees=0.f) noexcept {
float headYawDegrees=0.f,bool horizontalFocus=false) noexcept {
if(!active())return {};
if(untilGeometry_==0){
updateGeometry(azimuth,spread,headYawDegrees);
Expand Down Expand Up @@ -398,14 +398,29 @@ class SonKuEarlyReflections final {
#if defined(SONKU_P83_PHYSICAL_SPEAKER_RESEARCH) && SONKU_P83_PHYSICAL_SPEAKER_RESEARCH
if((p83WallMask_ & (1u<<wall))!=0u) {
#endif
output.left+=p.gainL*l;
output.right+=p.gainR*r;
// Keep all 4 horizontal images and nonzero vertical
// room cues, preventing ceiling/floor phantom dominance.
// Filter kernels and ITD/ILD stay physically modelled.
if(horizontalFocus && wall>=wallCount){
const float verticalWeight=wall==wallCount?.24f:.15f;
output.left+=verticalWeight*(p.gainL*l);
output.right+=verticalWeight*(p.gainR*r);
}else{
output.left+=p.gainL*l;
output.right+=p.gainR*r;
}
#if defined(SONKU_P83_PHYSICAL_SPEAKER_RESEARCH) && SONKU_P83_PHYSICAL_SPEAKER_RESEARCH
}
#endif
}else{
output.left+=p.gainL*delayed(s,p.delayL);
output.right+=p.gainR*delayed(s,p.delayR);
if(horizontalFocus && wall>=wallCount){
const float verticalWeight=wall==wallCount?.24f:.15f;
output.left+=verticalWeight*(p.gainL*delayed(s,p.delayL));
output.right+=verticalWeight*(p.gainR*delayed(s,p.delayR));
}else{
output.left+=p.gainL*delayed(s,p.delayL);
output.right+=p.gainR*delayed(s,p.delayR);
}
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions engine/builtin_fx/sonku/SonKuP83SpeakerScene.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ enum class Mode : std::uint8_t {
MusicSpatialP84=3
#if defined(SONKU_P85_WORLD_COHERENCE_RESEARCH) && SONKU_P85_WORLD_COHERENCE_RESEARCH
,MusicSpatialP85=4
#if defined(SONKU_P86_HORIZONTAL_FOCUS_RESEARCH) && SONKU_P86_HORIZONTAL_FOCUS_RESEARCH
,MusicSpatialP86=5
#endif
#endif
#endif
};
Expand All @@ -23,6 +26,9 @@ inline bool valid(Mode m) noexcept {
|| m==Mode::MusicSpatialP84
#if defined(SONKU_P85_WORLD_COHERENCE_RESEARCH) && SONKU_P85_WORLD_COHERENCE_RESEARCH
|| m==Mode::MusicSpatialP85
#if defined(SONKU_P86_HORIZONTAL_FOCUS_RESEARCH) && SONKU_P86_HORIZONTAL_FOCUS_RESEARCH
|| m==Mode::MusicSpatialP86
#endif
#endif
#endif
;
Expand Down
Loading
Loading