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
19 changes: 18 additions & 1 deletion .github/workflows/p1-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,16 @@ jobs:
/tmp/sonku-p96-candidate > /tmp/sonku-p96-candidate.csv
cat /tmp/sonku-p96-reference.csv /tmp/sonku-p96-candidate.csv
python3 scripts/verify_sonku_p96_bands.py /tmp/sonku-p96-reference.csv /tmp/sonku-p96-candidate.csv
if [[ "${{ github.head_ref }}" == feat/sonku-p95-p96-p97-* ]]; then
g++ -std=c++20 -O2 -Wall -Wextra -Werror -pedantic tests/sonku_p97_stage_impact_source_test.cpp -o /tmp/sonku-p97-unit
/tmp/sonku-p97-unit
g++ $FLAGS -DSONKU_P94_FRONT_BACK_DEPTH_RESEARCH=1 -DSONKU_P95_MUSICAL_PRESENCE_RESEARCH=1 -DSONKU_P96_DISTANCE_REINFORCEMENT_RESEARCH=1 tests/sonku_p97_full_pcm_test.cpp -o /tmp/sonku-p97-reference
/tmp/sonku-p97-reference > /tmp/sonku-p97-reference.csv
g++ $FLAGS -DSONKU_P94_FRONT_BACK_DEPTH_RESEARCH=1 -DSONKU_P95_MUSICAL_PRESENCE_RESEARCH=1 -DSONKU_P96_DISTANCE_REINFORCEMENT_RESEARCH=1 -DSONKU_P97_STAGE_IMPACT_RESEARCH=1 tests/sonku_p97_full_pcm_test.cpp -o /tmp/sonku-p97-candidate
/tmp/sonku-p97-candidate > /tmp/sonku-p97-candidate.csv
cat /tmp/sonku-p97-reference.csv /tmp/sonku-p97-candidate.csv
python3 scripts/verify_sonku_p97_stage_impact.py /tmp/sonku-p97-reference.csv /tmp/sonku-p97-candidate.csv
fi
fi
fi
g++ $FLAGS tests/sonku_p89_stereo_room_depth_source_test.cpp -o /tmp/sonku-p89
Expand Down Expand Up @@ -731,6 +741,7 @@ jobs:
run: |
$p95flag = if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-*') { 'ON' } else { 'OFF' }
$p96flag = if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-p96-*') { 'ON' } else { 'OFF' }
$p97flag = if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-p96-p97-*') { 'ON' } else { 'OFF' }
cmake -S . -B build -G "Visual Studio 17 2022" -A x64 `
-DJUCE_ROOT="$env:GITHUB_WORKSPACE/third_party/JUCE" `
-DJUCE_WEBVIEW2_PACKAGE_LOCATION="$env:GITHUB_WORKSPACE/.deps" `
Expand All @@ -749,6 +760,7 @@ jobs:
-DARMIX_SONKU_EXPERIMENTAL_P94_FRONT_BACK_DEPTH=ON `
-DARMIX_SONKU_EXPERIMENTAL_P95_MUSICAL_PRESENCE=$p95flag `
-DARMIX_SONKU_EXPERIMENTAL_P96_DISTANCE_REINFORCEMENT=$p96flag `
-DARMIX_SONKU_EXPERIMENTAL_P97_STAGE_IMPACT=$p97flag `
-DBUILD_TESTING=ON
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
$cache = Get-Content build/CMakeCache.txt -Raw
Expand All @@ -764,6 +776,7 @@ jobs:
$targets = @('ARMixSonKuP94SourceTests','ARMixSonKuP94ReferenceTests','ARMixSonKuP91P92MusicBassTests','ARMixSonKuP90NativeTests','ARMixSonKuP90SourceTests','ARMixSonKuP89NativeTests','ARMixSonKuP89SourceTests','ARMixConsole')
if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-*') { $targets += 'ARMixSonKuP95MusicTests' }
if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-p96-*') { $targets += 'ARMixSonKuP96DistanceTests' }
if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-p96-p97-*') { $targets += 'ARMixSonKuP97StageTests' }
cmake --build build --config Release --parallel 2 --target $targets
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
if (-not (Test-Path -LiteralPath 'build/ARMixConsole_artefacts/Release/AR MIX Studio.exe' -PathType Leaf)) {
Expand All @@ -772,6 +785,7 @@ jobs:
$tests = '^NativeSonKuP(89RoomAnchoredStereoAndP88GoldenParity|89JuceV10AppliedAckAndV9Restore|90StereoExternalizationSource|90JuceV11AppliedAckAndLegacyRestore|91P92MusicFidelityWorldBassAndRoom|94FrontBackDepthA_BSource|94LevelMatchedAB'
if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-*') { $tests += '|95MusicPresenceVenue' }
if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-p96-*') { $tests += '|96DistanceBassAndTrebleRetention' }
if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-p96-p97-*') { $tests += '|97BassVocalExternalAirSafety' }
$tests += ')$'
ctest --test-dir build -C Release --output-on-failure -R $tests
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
Expand All @@ -792,14 +806,17 @@ jobs:
Copy-Item docs/SONKU_P95_IMMERSIVE_MUSIC_VENUE_FAT_20261116.md dist/SONKU_P95_MUSIC_VENUE_FAT.md
if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-p96-*') {
Copy-Item docs/SONKU_P96_DISTANCE_REINFORCEMENT_FAT_20261116.md dist/SONKU_P96_DISTANCE_FAT.md
if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-p96-p97-*') {
Copy-Item docs/SONKU_P97_STAGE_IMPACT_FAT_20261116.md dist/SONKU_P97_STAGE_FAT.md
}
}
}
$provenance = Get-Content -LiteralPath dist/BUILD_PROVENANCE.json -Raw | ConvertFrom-Json
if ($provenance.sourceCommit -ne (git rev-parse HEAD).Trim()) {
throw 'SONKU_P90_SOURCE_COMMIT_MISMATCH'
}
$provenance | Add-Member -Force -NotePropertyName sonkuExperiment -NotePropertyValue @{
mode = if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-p96-*') { 'P9.6_STAGE_BASS_AIR_DISTANCE_RESEARCH' } elseif ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-*') { 'P9.5_IMMERSIVE_MUSIC_VENUE_FOUNDATION' } else { 'P9.4_FRONT_REAR_DEPTH_EXPERIMENT' }
mode = if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-p96-p97-*') { 'P9.7_STAGE_IMPACT_EXTERNAL_PRESENCE_RESEARCH' } elseif ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-p96-*') { 'P9.6_STAGE_BASS_AIR_DISTANCE_RESEARCH' } elseif ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-*') { 'P9.5_IMMERSIVE_MUSIC_VENUE_FOUNDATION' } else { 'P9.4_FRONT_REAR_DEPTH_EXPERIMENT' }
stateSchema = 11
headphoneFat = 'PENDING'
publicRelease = $false
Expand Down
21 changes: 19 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@ if(ARMIX_SONKU_EXPERIMENTAL_P96_DISTANCE_REINFORCEMENT AND
NOT ARMIX_SONKU_EXPERIMENTAL_P95_MUSICAL_PRESENCE)
message(FATAL_ERROR "P9.6 requires P9.5 musical presence and P9 world speaker")
endif()
# P9.7 is research only and never changes the approved P9.6 checkpoint.
option(ARMIX_SONKU_EXPERIMENTAL_P97_STAGE_IMPACT
"Private P9.7 concert bass impact, center HRTF and binaural early air" OFF)
if(ARMIX_SONKU_EXPERIMENTAL_P97_STAGE_IMPACT AND
NOT ARMIX_SONKU_EXPERIMENTAL_P96_DISTANCE_REINFORCEMENT)
message(FATAL_ERROR "P9.7 requires the P9.6 sound-reinforced world-speaker engine")
endif()
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

Expand Down Expand Up @@ -339,7 +346,9 @@ target_compile_definitions(ARMixConsole PRIVATE
$<$<BOOL:${ARMIX_SONKU_EXPERIMENTAL_P95_MUSICAL_PRESENCE}>:ARMIX_SONKU_EXPERIMENTAL_P95_MUSICAL_PRESENCE=1>
$<$<BOOL:${ARMIX_SONKU_EXPERIMENTAL_P95_MUSICAL_PRESENCE}>:SONKU_P95_MUSICAL_PRESENCE_RESEARCH=1>
$<$<BOOL:${ARMIX_SONKU_EXPERIMENTAL_P96_DISTANCE_REINFORCEMENT}>:SONKU_P96_DISTANCE_REINFORCEMENT_RESEARCH=1>
$<$<BOOL:${ARMIX_SONKU_EXPERIMENTAL_P96_DISTANCE_REINFORCEMENT}>:ARMIX_SONKU_EXPERIMENTAL_P96_DISTANCE_REINFORCEMENT=1>)
$<$<BOOL:${ARMIX_SONKU_EXPERIMENTAL_P96_DISTANCE_REINFORCEMENT}>:ARMIX_SONKU_EXPERIMENTAL_P96_DISTANCE_REINFORCEMENT=1>
$<$<BOOL:${ARMIX_SONKU_EXPERIMENTAL_P97_STAGE_IMPACT}>:SONKU_P97_STAGE_IMPACT_RESEARCH=1>
$<$<BOOL:${ARMIX_SONKU_EXPERIMENTAL_P97_STAGE_IMPACT}>:ARMIX_SONKU_EXPERIMENTAL_P97_STAGE_IMPACT=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 @@ -874,7 +883,8 @@ if(BUILD_TESTING)
$<TARGET_PROPERTY:ARMixSonKuP91P92MusicBassTests,COMPILE_DEFINITIONS>
SONKU_P94_FRONT_BACK_DEPTH_RESEARCH=1
SONKU_P95_MUSICAL_PRESENCE_RESEARCH=1
$<$<BOOL:${ARMIX_SONKU_EXPERIMENTAL_P96_DISTANCE_REINFORCEMENT}>:SONKU_P96_DISTANCE_REINFORCEMENT_RESEARCH=1>)
$<$<BOOL:${ARMIX_SONKU_EXPERIMENTAL_P96_DISTANCE_REINFORCEMENT}>:SONKU_P96_DISTANCE_REINFORCEMENT_RESEARCH=1>
$<$<BOOL:${ARMIX_SONKU_EXPERIMENTAL_P97_STAGE_IMPACT}>:SONKU_P97_STAGE_IMPACT_RESEARCH=1>)
add_test(NAME NativeSonKuP95MusicPresenceVenue
COMMAND ARMixSonKuP95MusicTests)
endif()
Expand All @@ -885,6 +895,13 @@ if(BUILD_TESTING)
add_test(NAME NativeSonKuP96DistanceBassAndTrebleRetention
COMMAND ARMixSonKuP96DistanceTests)
endif()
if(ARMIX_SONKU_EXPERIMENTAL_P97_STAGE_IMPACT)
add_executable(ARMixSonKuP97StageTests
tests/sonku_p97_stage_impact_source_test.cpp)
target_compile_features(ARMixSonKuP97StageTests PRIVATE cxx_std_20)
add_test(NAME NativeSonKuP97BassVocalExternalAirSafety
COMMAND ARMixSonKuP97StageTests)
endif()
juce_add_console_app(ARMixSonKuP90NativeTests
PRODUCT_NAME "ArSonMix SonKu P90 JUCE v11 State Tests")
target_sources(ARMixSonKuP90NativeTests PRIVATE
Expand Down
31 changes: 31 additions & 0 deletions docs/SONKU_P97_STAGE_IMPACT_FAT_20261116.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# SonKu P9.7 Stage Impact and External Presence — PRIVATE FAT, 2026-11-16

**Selected listening checkpoint:** P9.6 PR #727 head `720cec619b41aa601414d4b5ae664cb418f04ca1`. User confirmed P9.6 is already reasonably good; preserve it immutably for A/B. P9.7 is a child branch and does not rebase P9.6, alter `main`, merge the competing P9.5 PR #724, or change old .smix bytes.

## Research, limits, and actual algorithm

- [Sound Externalization: A Review of Recent Research](https://pmc.ncbi.nlm.nih.gov/articles/PMC7488874/) describes the significance of direct pinna cues, realistic interaural differences in reverberation, and room/source congruence. Real externalization requires headphone listening and cannot be proven by spectral gain or generalized KEMAR only.
- [Jiang et al., effect of pinna filtering](https://doi.org/10.1016/j.apacoust.2020.107257) finds direct pinna filtering helps externalization whereas applying it to diffuse reverberation can reduce externalization. We retain the measured direct HRIR and existing non-pinna image-source ER path.
- [AES virtual bass review](https://aes.org/publications/elibrary/elibrary-page/?id=18050) documents perceived bass versus distortion risks. We DO NOT generate missing-fundamental harmonics, synthesize extra LFE, or attach a headlocked mono bass.

One opt-in **native P9.7** component (`SonKuP97StageImpact.h`) adds three bounded paths to the existing P9 mode-9 scene only when ROOM is ON and distance is above 2m. All parameters are research constants, not hardcoded .smix fields or hidden GUI pseudo-controls:

1. **Concert punch / room body:** prepared, low-Q ~85Hz bandpass at +0.23 relative peak to the already HRTF/P9.6-processed direct ear pressure; one-pole 62Hz sub body at +0.085. The existing P9.2 position-aware damped 3-mode low-frequency *room return* is modestly increased by at most 12%, without modifying resonator decay or creating uncontrolled feedback.
2. **Center-panned presence (not vocal separation):** low-Q ~1.9kHz bandpass of INPUT L+R MID with at most +0.19 on both virtual speaker source feeds, before existing full KEMAR HRIR convolution. The center-band is filtered twice to suppress high-frequency phase leakage, and a further modest +0.085 centered presence band is added to the *already HRIR-positioned direct ears*, never a dry mono voice. The original stereo feeds remain authoritative for decoder observation, P9.2 world bass and room reflections. No dry/headlocked vocal injection or extra FIR. This can enhance centered vocal *and centered instruments*; it is NOT an AI stem separator.
3. **Early-reflection air:** +0.24 of the high-pass complement above 4.5kHz, applied only to the existing two-ear directional early-reflection result. No inter-channel mixing, Haas timing, repeated reverb worker or extra spectral EQ on the diffuse tail. This aims to improve high-frequency spatial cues without simply making room reverb hissier.

A small +0.038 high-frequency direct-air complement preserves the already-external KEMAR cymbal/treble energy when the center-band is boosted, avoiding the earlier P9.7 first-pass regression where 7.5kHz electrical energy fell by ~13% at 10m. An explicit no-high-loss test now rejects that outcome. P9.5's adaptive upward makeup was found to reduce its overall gain as P9.7 made bass and center louder; in the first integrated candidate 7.5kHz remained ~16% below P9.6 even after the center-band filter was narrowed. A bounded 135Hz low complement (+0.080 max) and 4.5kHz high complement (+0.35 max) are therefore applied to the **already externalized, post-P9.5 stereo ear signal** immediately before the unchanged linked 0.98 peak guard. This last-stage gain is not an extra dry/stem/reverb path, and identical bilateral coefficients preserve channel-based localization cues. A test checks spectral output *after* P9.5 normalization. Reject the design if the limiter's dynamic pumping increases on music FAT.

All P9.7 source, direct/early/modal and post-makeup stages are explicitly disabled at 0% spatial MIX so the existing native dry/bypass is preserved bit for bit; the full-PCM hash verifier covers that case with ROOM still enabled at 10m.

The three gains ramp together over 45ms as distance moves through 2–6m. All bands use control-side prepared coefficients, bounded stable filters, fixed memory and no callback allocations. No new EQ slots, public schema, selectable render modes, fake stereo widening or additional HRTF graph. P9.5 output makeup and 0.98 linked peak guard remain unchanged.

## Gates before approving listening audio

1. Independently compile 44.1/48k source tests for exact ROOM OFF, 0% spatial MIX with active ROOM, and <=2m, voice/air/bass response, finite PCM, antiphase symmetry, bounded room-modal amplification and no device-restart stale memory.
2. Compare complete P9.6 and P9.7 native PCM *hashes* at 2m and ROOM OFF, and target bands at 3.1m and 10m (front and back) for 44.1/48k, using the very same source fixture. The checkpoint must remain bit-for-bit identical in disabled scenes. This guards known-good sound rather than relying on nominal gains.
3. Compile exact Windows JUCE application, V11 state/ACK, sample-peak safety CTests, UI Chromium and source-provenance portable in a branch-qualified build. No public release/merge based on a green Linux source test alone.
4. Operator headphone A/B at matching LUFS and also matching *GAIN setting*: kick/tom attack, bass audibility and decay, center vocal location and intelligibility, edge/cymbal air, interaural position, stage distance, reverb body, 0/90/180/270° and 44.1/48k. Reject nasal vocals, metallic cymbals, mono collapse, bass masking, over-limiter pumping, apparent image moving inside the head. User preference controls promotion.
5. No marketing claim of source-separated vocals, customized individual BRIR, measured live concert loudspeaker impulse response, true-peak certification or dearVR acoustic parity.

**Checkpoint:** P9.6 remains branch/PR #727 and this draft P9.7 is entirely removable by deleting its child branch. Feature OFF recovers P9.6 binary behavior and no new user parameter exists.
Loading
Loading