Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
14 commits
Select commit Hold shift + click to select a range
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
314 changes: 314 additions & 0 deletions .github/workflows/sonku-p88-windows-field.yml

Large diffs are not rendered by default.

60 changes: 59 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ if(ARMIX_SONKU_EXPERIMENTAL_P87_NATIVE_RT AND
NOT ARMIX_SONKU_EXPERIMENTAL_P86_NATIVE_RT)
message(FATAL_ERROR "P8.7 music body requires P8.6 horizontal focus research")
endif()
# Listener-calibrated HRTF elevation independent of physical source XYZ.
option(ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT
"Private P8.8 HRTF vertical alignment and source distance research" OFF)
if(ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT AND
NOT ARMIX_SONKU_EXPERIMENTAL_P87_NATIVE_RT)
message(FATAL_ERROR "P8.8 needs private P8.7 music-body research")
endif()
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

Expand Down Expand Up @@ -284,7 +291,9 @@ target_compile_definitions(ARMixConsole PRIVATE
$<$<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>
$<$<BOOL:${ARMIX_SONKU_EXPERIMENTAL_P87_NATIVE_RT}>:ARMIX_SONKU_EXPERIMENTAL_P87_NATIVE_RT=1>
$<$<BOOL:${ARMIX_SONKU_EXPERIMENTAL_P87_NATIVE_RT}>:SONKU_P87_MUSIC_BODY_RESEARCH=1>)
$<$<BOOL:${ARMIX_SONKU_EXPERIMENTAL_P87_NATIVE_RT}>:SONKU_P87_MUSIC_BODY_RESEARCH=1>
$<$<BOOL:${ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT}>:ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT=1>
$<$<BOOL:${ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT}>:SONKU_P88_PERCEPTUAL_ALIGNMENT_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 @@ -645,6 +654,55 @@ if(BUILD_TESTING)
SONKU_P87_MUSIC_BODY_RESEARCH=1)
add_test(NAME NativeSonKuP87JuceV8AudioAppliedAckV7Restore
COMMAND ARMixSonKuP87NativeTests)
if(ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT)
add_executable(ARMixSonKuP88SourceTests
tests/sonku_p88_height_distance_source_test.cpp)
target_compile_features(ARMixSonKuP88SourceTests PRIVATE cxx_std_20)
target_compile_definitions(ARMixSonKuP88SourceTests 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
SONKU_P87_MUSIC_BODY_RESEARCH=1
SONKU_P88_PERCEPTUAL_ALIGNMENT_RESEARCH=1)
add_test(NAME NativeSonKuP88MeasuredEarHeightAndDistanceDrr
COMMAND ARMixSonKuP88SourceTests)
juce_add_console_app(ARMixSonKuP88NativeTests
PRODUCT_NAME "ArSonMix SonKu P88 JUCE v9 State Tests")
target_sources(ARMixSonKuP88NativeTests PRIVATE
tests/sonku_p88_native_juce_v9_test.cpp)
target_compile_features(ARMixSonKuP88NativeTests PRIVATE cxx_std_20)
target_link_libraries(ARMixSonKuP88NativeTests PRIVATE
juce::juce_audio_processors juce::juce_recommended_config_flags)
target_compile_definitions(ARMixSonKuP88NativeTests 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
ARMIX_SONKU_EXPERIMENTAL_P87_NATIVE_RT=1
ARMIX_SONKU_EXPERIMENTAL_P88_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
SONKU_P87_MUSIC_BODY_RESEARCH=1
SONKU_P88_PERCEPTUAL_ALIGNMENT_RESEARCH=1)
add_test(NAME NativeSonKuP88JuceV9AppliedAckAndV8Restore
COMMAND ARMixSonKuP88NativeTests)
endif()
endif()
endif()
endif()
Expand Down
36 changes: 36 additions & 0 deletions docs/SONKU_P88_PERCEPTUAL_HEIGHT_DISTANCE_20261115.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# SonKu P8.8 — Perceptual Ear Height Calibration and True Distance Cues
Private headphone FAT, 2026-11-15. **No merge to main, no public release.**

## Owner report (screenshot + ears)

P8.7, 28.8m LARGE, 7.3m source distance, **-7.4° physical elevation**, 100% early reflections, 100% reverb, yaw 0°, 24° speaker angle (orbit may be ON), 100% spatial, +2.5dB output: still near and consistently above ear/head. Moving physical elevation slightly down helped a bit, not enough. P8.6 speaker was more focused; P8.7 added air/bass; preserve both. Not a request to automatically reset controls.

## Exact source proof

1. Source geometry uses `sourceHeight = earHeight 1.45m + distance*sin(elevation)`. At 7.3m / -7.4°, **source height ≈0.51m, only 1cm above allowed room floor safety boundary**. More negative physical elevation is not physically possible in that room. The physical Z projection is correctly signed; native measured 3D HRIR interpolation is actually invoked when elevation is nonzero.
2. The KEMAR HRIR bank is **generic, not individualized**. Correct physical 0/-7.4° can be *perceived* as too high for a particular listener/headphone. Spectral peaks/notches from pinna and headphone transfer determine vertical perception, not ILD/ITD alone. Objective HRIR horizontal calibration cannot prove subjective height.
3. P8.7 deliberately uses `targetDirectDistance=1/(1+0.13*(r-1.6))` to preserve direct musical clarity. At 7.3m this gives ≈0.574 (~-4.8dB), while physical inverse-distance 1.6/7.3≈0.219 (~-13.2dB). The deliberately strong direct component can produce proximity despite distant UI setting. More importantly, original transparent stereo music LF is returned with **zero source-distance attenuation** even with ROOM ON. A distant high-band HRTF with an invariant headphone LF can feel near/in-head.
4. The room's horizontal four-wall, suppressed floor/ceiling and P8.7 direct air/FDN music-body are not broken by simply moving SOURCE ELEVATION. A 100% reverb user setting can mask direction, but automatically lowering it would rewrite the owner's scene and defeat A/B.

## External literature, not copied code

- Wang et al., Applied Acoustics (2025): spectral contrast and notches alter median-plane height localization, with up/down confusions in dynamic HRTF render: https://www.sciencedirect.com/science/article/pii/S0003682X24005759 .
- Auditory localization practical review (2024): generic HRTFs lead to elevation and externalization errors: https://pmc.ncbi.nlm.nih.gov/articles/PMC11267622/ .
- Hassager et al. pinna filtering: direct vs reflected spectral features and ear coherence matter for externalization: https://doi.org/10.1016/j.apacoust.2020.107257 .
- 2026 frontal BRIR study: DRR, spatial reflection level/direction and head rotation together contribute to externalization, not overall wet level alone: https://pmc.ncbi.nlm.nih.gov/articles/PMC13451706/ .

## P8.8 experiment — explicit opt-in mode 7

- Separate **SOURCE ELEVATION (physical XYZ)** from **EAR HEIGHT ALIGN · HRTF (perceptual KEMAR spectral lookup)**. The new trim is -30° .. +20° with default 0° and a combined measured lookup limited to -40° .. 60°. A trim of -12° at physical 0° gives the exact same direct KEMAR FIR as physical -12° with trim 0 in P8.7, **without lowering speaker geometry, floor reflection image, direct geometric distance or listener position**. This is user calibration, **not** an automatic guaranteed perceptual fix.
- Moderate P8.8-only source-distance law for direct high-band: `1/(1+0.27*(r-1.6))` = 0.394 at 7.3m (~-8.1 dB). Unlike P8.7 ~0.574, spatial direct is ~3.3 dB further back. No newly amplified six-wall ER, no diffuse reverb gain increase, no 1/r hard attenuation.
- Gentle P8.8-only distance effect on original stereo LF: `1/(1+0.10*(r-1.6))` = 0.637 at 7.3m, retaining musical low-body while removing old invariant head-locked LF near cue. The P8.7 existing FDN LF room-body and direct-air stay in place unchanged.
- Keep world/head yaw, MID/SIDE, fused two direct FIRs, four horizontal reflection pressures, floor 24%, ceiling 15%, ER 76%, tail 38%, P8.7 +1.9dB bounded direct air shelf, late LF body and all user controls. No extra FIR, audio callback, samples, heap or locks.
- **Mode 7, native schema v9**, readback/typed ACK. One new 4-byte float appended to old 59-byte state, total **63 bytes**. v1..v8 old sessions retain mode and do not acquire perceptual trim. The rejected P8.3 modes 1/2 remain blocked. The trim is inactive in legacy modes even if saved in a P8.8 session. Public default build flag `ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT` is OFF.

## Qualification

- Native core tests at 44.1/48k: P8.8 ROOM OFF trim0 exactly P8.7 at azimuth 0/90/180 and yaw 0/60/180 for correlated + anti-phase, 64/128 parity. P8.8 physical0 trim-12 has **bit-exact direct ROOM OFF PCM** versus P8.7 physical-12 trim0; physical source heights must differ.
- 7.3m LARGE no wet: P8.8 farther direct and LF pressure than P8.7, finite peak/output. User 100% ER/reverb wet tests at effective elevations -20,-10,0,+10, same 64/128.
- Real JUCE v9 test: native audio-applied ACK, 63-byte state and v8 P8.7 mode6 no-trim restoration; v7 P8.6 mode5, v6 P8.5 mode4, v5 P8.4 mode3; forbidden P8.3. Check GUI capability tied to native v9 and approved embedded Pages resources. Linux source tests **do not replace** native Windows/ASIO/headphone FAT.
- Listening: choose **STATIC not ORBIT** to establish direction, speaker angle ~60° and azimuth FRONT; SOURCE ELEVATION **0° (physical ear height)**, EAR HEIGHT ALIGN trim **0°, -5°, -10°, -15°, -20°** A/B. Set distance 1.6/3/7.3m. Compare ROOM OFF first (vertical HRTF) then LARGE reverb 25/47/100% (DRR and floor/ceiling impression). Then rotate yaw ±60/90/180 and world speaker azimuth. Compare P8.7 with P8.8 trim0 and matched loudness. If none of the generic KEMAR spectral positions reproduces ear-level localization, **do not keep blindly shifting downward**: next valid step is individualized HRTF/headphone EQ calibration or alternate public HRIR subjects.
- This is a **controlled headphone FAT candidate**. A more negative HRTF lookup does NOT guarantee perceptually lower sound for every user and may alter timbre or front/back accuracy. Do not call P8.8 a qualified fix, dearVR match or measured personal HRTF.
24 changes: 24 additions & 0 deletions engine/builtin_fx/SonKuSpatialProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,11 @@ class SonKuSpatialProcessor final : public juce::AudioProcessor,
#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
#if defined(ARMIX_SONKU_EXPERIMENTAL_P87_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P87_NATIVE_RT
#if defined(ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT
out.writeInt(9); // v8 59-byte state + 4-byte HRTF trim
#else
out.writeInt(8); // same 59-byte layout; modes 0/3/4/5/6
#endif
#else
out.writeInt(7); // 59-byte layout; mode 5, old sessions intact
#endif
Expand Down Expand Up @@ -198,13 +202,20 @@ class SonKuSpatialProcessor final : public juce::AudioProcessor,
out.writeInt(accepted_.renderMode);
out.writeByte(accepted_.musicCompatibleLowFrequency?1:0);
out.writeFloat(accepted_.headYawDegrees);
#endif
#if defined(ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT
out.writeFloat(accepted_.hrtfElevationTrimDegrees);
#endif
}
bool restoreUnpublishedState(const void* data,int size) {
if(published_||!data||
#if defined(ARMIX_SONKU_EXPERIMENTAL_NATIVE_XYZ_RT) && ARMIX_SONKU_EXPERIMENTAL_NATIVE_XYZ_RT
#if defined(ARMIX_SONKU_EXPERIMENTAL_P83_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P83_NATIVE_RT
#if defined(ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT
(size!=30&&size!=46&&size!=50&&size!=59&&size!=63)||
#else
(size!=30&&size!=46&&size!=50&&size!=59)||
#endif
#else
(size!=30&&size!=46&&size!=50)||
#endif
Expand All @@ -228,6 +239,9 @@ class SonKuSpatialProcessor final : public juce::AudioProcessor,
&&version!=7
#if defined(ARMIX_SONKU_EXPERIMENTAL_P87_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P87_NATIVE_RT
&&version!=8
#if defined(ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT
&&version!=9
#endif
#endif
#endif
#endif
Expand All @@ -247,6 +261,9 @@ class SonKuSpatialProcessor final : public juce::AudioProcessor,
||(version==7&&size!=59)
#if defined(ARMIX_SONKU_EXPERIMENTAL_P87_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P87_NATIVE_RT
||(version==8&&size!=59)
#if defined(ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT
||(version==9&&size!=63)
#endif
#endif
#endif
#endif
Expand Down Expand Up @@ -317,11 +334,18 @@ class SonKuSpatialProcessor final : public juce::AudioProcessor,
if(version==8 && next.renderMode!=0 && next.renderMode!=3 &&
next.renderMode!=4 && next.renderMode!=5 && next.renderMode!=6)return false;
if(version==8 && next.musicCompatibleLowFrequency)return false;
#if defined(ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT
if(version==9 && next.renderMode!=0 && next.renderMode!=3 && next.renderMode!=4 && next.renderMode!=5 && next.renderMode!=6 && next.renderMode!=7)return false;
if(version==9 && next.musicCompatibleLowFrequency)return false;
#endif
#endif
#endif
#endif
#endif
}
#endif
#if defined(ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT
if(version>=9)next.hrtfElevationTrimDegrees=in.readFloat();
#endif
// v1 OFF, v2 original scene; experimental v3 includes direct
// elevation, and is rejected by ordinary public v2 builds.
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 @@ -16,6 +16,9 @@ enum class Mode : std::uint8_t {
,MusicSpatialP86=5
#if defined(SONKU_P87_MUSIC_BODY_RESEARCH) && SONKU_P87_MUSIC_BODY_RESEARCH
,MusicSpatialP87=6
#if defined(SONKU_P88_PERCEPTUAL_ALIGNMENT_RESEARCH) && SONKU_P88_PERCEPTUAL_ALIGNMENT_RESEARCH
,MusicSpatialP88=7
#endif
#endif
#endif
#endif
Expand All @@ -33,6 +36,9 @@ inline bool valid(Mode m) noexcept {
|| m==Mode::MusicSpatialP86
#if defined(SONKU_P87_MUSIC_BODY_RESEARCH) && SONKU_P87_MUSIC_BODY_RESEARCH
|| m==Mode::MusicSpatialP87
#if defined(SONKU_P88_PERCEPTUAL_ALIGNMENT_RESEARCH) && SONKU_P88_PERCEPTUAL_ALIGNMENT_RESEARCH
|| m==Mode::MusicSpatialP88
#endif
#endif
#endif
#endif
Expand Down
Loading
Loading