Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a8fbc8e
fix(sonku): hold speaker pose while native insert bypassed and discar…
masarray Nov 16, 2026
8dda3a4
feat(sonku): curate operator-matched immersive/cinema/venue preset sc…
masarray Nov 16, 2026
74c0f1e
feat(sonku): bounded slow upward-only music energy compensation prese…
masarray Nov 16, 2026
91ef229
feat(sonku): opt-in slow bounded native makeup in mode9 with existing…
masarray Nov 16, 2026
d77657f
build(sonku): P9.5 musical-presence feature flag OFF by default, requ…
masarray Nov 16, 2026
0b6f62a
feat(sonku): publish honest native P9.5 presence capability only when…
masarray Nov 16, 2026
5f7eab6
ui(sonku): honest P9.5 musical presence capability and clean latest-e…
masarray Nov 16, 2026
02eec64
test(sonku): update latest-only menu, authoritative bypass motion fre…
masarray Nov 16, 2026
67f2421
test(sonku): update latest-only menu, authoritative bypass motion fre…
masarray Nov 16, 2026
f409fbf
feat(sonku): new P9.5 inserts start with operator-proven immersive sc…
masarray Nov 16, 2026
cfdf34a
feat(sonku): small bounded real LF room-mode reinforcement for large …
masarray Nov 16, 2026
2ab78f5
test(sonku): P9.5 real DSP stereo RMS, 44.1/48k, makeup no-pump and 6…
masarray Nov 16, 2026
2490ca2
test(build): add exact native P95 C++ DSP executable to scoped CTest
masarray Nov 16, 2026
2034a9f
docs(sonku): operator reference, P9.5 scope, rigorous loudness and ro…
masarray Nov 16, 2026
0a98a29
ci(sonku): scoped P9.5 source and Windows JUCE/CTest portable FAT wit…
masarray Nov 16, 2026
a972c56
test(sonku): pass accepted mode9 scene to source-extracted native pop…
masarray Nov 16, 2026
b703e2f
test(sonku): stable latest-menu writes remain one after older capabil…
masarray Nov 16, 2026
e1468a3
test(sonku): assembled Chromium verifies bypass freezes icons without…
masarray Nov 16, 2026
661ac0e
test(sonku): Chromium preset ACK verifies operator-referenced 3.1m fu…
masarray Nov 16, 2026
b1917b2
test(sonku): native ON readback required before visual clock; UNKNOWN…
masarray Nov 16, 2026
26809c6
fix(sonku): signature default matches operator 6.5s clockwise orbit r…
masarray Nov 16, 2026
b2ad631
fix(sonku): signature default matches operator 6.5s clockwise orbit r…
masarray Nov 16, 2026
b895d92
fix(sonku): signature default matches operator 6.5s clockwise orbit r…
masarray Nov 16, 2026
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
24 changes: 19 additions & 5 deletions .github/workflows/p1-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ jobs:
sonku-p90-source:
# Runs only on the P9 research PR, even while its production jobs skip.
name: SonKu P9 exact-source C++ PCM preflight
if: ${{ github.event_name == 'pull_request' && (startsWith(github.event.pull_request.head.ref, 'research/sonku-p90-') || (startsWith(github.event.pull_request.head.ref, 'research/sonku-p91-p92-') || (startsWith(github.event.pull_request.head.ref, 'feat/sonku-p93-') || startsWith(github.event.pull_request.head.ref, 'research/sonku-p94-')))) }}
if: ${{ github.event_name == 'pull_request' && (startsWith(github.event.pull_request.head.ref, 'research/sonku-p90-') || (startsWith(github.event.pull_request.head.ref, 'research/sonku-p91-p92-') || (startsWith(github.event.pull_request.head.ref, 'feat/sonku-p93-') || (startsWith(github.event.pull_request.head.ref, 'research/sonku-p94-') || startsWith(github.event.pull_request.head.ref, 'feat/sonku-p95-'))))) }}
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
Expand All @@ -684,14 +684,18 @@ jobs:
g++ $FLAGS -DSONKU_P94_FRONT_BACK_DEPTH_RESEARCH=1 tests/sonku_p94_front_back_depth_source_test.cpp -o /tmp/sonku-p94
/tmp/sonku-p94
python3 scripts/verify_sonku_p94_acoustic_levels.py /tmp/sonku-p94-reference /tmp/sonku-p94
if [[ "${{ github.head_ref }}" == feat/sonku-p95-* ]]; then
g++ $FLAGS -DSONKU_P94_FRONT_BACK_DEPTH_RESEARCH=1 -DSONKU_P95_MUSICAL_PRESENCE_RESEARCH=1 tests/sonku_p95_musical_presence_source_test.cpp -o /tmp/sonku-p95
/tmp/sonku-p95
fi
g++ $FLAGS tests/sonku_p89_stereo_room_depth_source_test.cpp -o /tmp/sonku-p89
/tmp/sonku-p89
echo "SONKU_P90_NATIVE_SOURCE_CTEST_PASSED"

sonku-p90-windows-fat:
name: SonKu P9 actual JUCE / GUI portable x64
needs: sonku-p90-source
if: ${{ github.event_name == 'pull_request' && (startsWith(github.event.pull_request.head.ref, 'research/sonku-p90-') || (startsWith(github.event.pull_request.head.ref, 'research/sonku-p91-p92-') || (startsWith(github.event.pull_request.head.ref, 'feat/sonku-p93-') || startsWith(github.event.pull_request.head.ref, 'research/sonku-p94-')))) }}
if: ${{ github.event_name == 'pull_request' && (startsWith(github.event.pull_request.head.ref, 'research/sonku-p90-') || (startsWith(github.event.pull_request.head.ref, 'research/sonku-p91-p92-') || (startsWith(github.event.pull_request.head.ref, 'feat/sonku-p93-') || (startsWith(github.event.pull_request.head.ref, 'research/sonku-p94-') || startsWith(github.event.pull_request.head.ref, 'feat/sonku-p95-'))))) }}
runs-on: windows-2022
timeout-minutes: 55
steps:
Expand All @@ -713,6 +717,7 @@ jobs:
- name: Configure the actual native app with P9 OFF by default except FAT
shell: pwsh
run: |
$p95flag = if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-*') { '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 @@ -729,6 +734,7 @@ jobs:
-DARMIX_SONKU_EXPERIMENTAL_P89_NATIVE_RT=ON `
-DARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT=ON `
-DARMIX_SONKU_EXPERIMENTAL_P94_FRONT_BACK_DEPTH=ON `
-DARMIX_SONKU_EXPERIMENTAL_P95_MUSICAL_PRESENCE=$p95flag `
-DBUILD_TESTING=ON
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
$cache = Get-Content build/CMakeCache.txt -Raw
Expand All @@ -741,12 +747,17 @@ jobs:
- name: Build real native JUCE PCM, state ACK, and Windows GUI
shell: pwsh
run: |
cmake --build build --config Release --parallel 2 --target ARMixSonKuP94SourceTests ARMixSonKuP94ReferenceTests ARMixSonKuP91P92MusicBassTests ARMixSonKuP90NativeTests ARMixSonKuP90SourceTests ARMixSonKuP89NativeTests ARMixSonKuP89SourceTests ARMixConsole
$targets = @('ARMixSonKuP94SourceTests','ARMixSonKuP94ReferenceTests','ARMixSonKuP91P92MusicBassTests','ARMixSonKuP90NativeTests','ARMixSonKuP90SourceTests','ARMixSonKuP89NativeTests','ARMixSonKuP89SourceTests','ARMixConsole')
if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-*') { $targets += 'ARMixSonKuP95MusicTests' }
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)) {
throw 'SONKU_P90_NATIVE_GUI_EXE_MISSING'
}
ctest --test-dir build -C Release --output-on-failure -R '^NativeSonKuP(89RoomAnchoredStereoAndP88GoldenParity|89JuceV10AppliedAckAndV9Restore|90StereoExternalizationSource|90JuceV11AppliedAckAndLegacyRestore|91P92MusicFidelityWorldBassAndRoom|94FrontBackDepthA_BSource|94LevelMatchedAB)$'
$tests = '^NativeSonKuP(89RoomAnchoredStereoAndP88GoldenParity|89JuceV10AppliedAckAndV9Restore|90StereoExternalizationSource|90JuceV11AppliedAckAndLegacyRestore|91P92MusicFidelityWorldBassAndRoom|94FrontBackDepthA_BSource|94LevelMatchedAB'
if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-*') { $tests += '|95MusicPresenceVenue' }
$tests += ')$'
ctest --test-dir build -C Release --output-on-failure -R $tests
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
- name: Verified portable package, no installer or release
shell: pwsh
Expand All @@ -761,12 +772,15 @@ jobs:
Copy-Item docs/SONKU_P90_TRUE_EXTERNAL_SPEAKER_FAT_20261115.md dist/SONKU_P90_FIELD_FAT.md
Copy-Item docs/SONKU_P91_P92_RECONCILED_MUSIC_FIDELITY_BASS_FAT_20261116.md dist/SONKU_P91_P92_FIELD_FAT.md
Copy-Item docs/SONKU_P94_FRONT_REAR_EXTERNALIZATION_FAT_20261116.md dist/SONKU_P94_FRONT_REAR_FAT.md
if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-*') {
Copy-Item docs/SONKU_P95_IMMERSIVE_MUSIC_VENUE_FAT_20261116.md dist/SONKU_P95_MUSIC_VENUE_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 = 'P9.4_FRONT_REAR_DEPTH_EXPERIMENT'
mode = if ($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
22 changes: 21 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ if(ARMIX_SONKU_EXPERIMENTAL_P94_FRONT_BACK_DEPTH AND
NOT ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT)
message(FATAL_ERROR "P9.4 depth cue requires the P9 measured two-speaker engine")
endif()
# Optional P9.5 upward-only, slow electrical musical presence. No public default.
option(ARMIX_SONKU_EXPERIMENTAL_P95_MUSICAL_PRESENCE
"Private P9.5 cinema/venue music-level compensation" OFF)
if(ARMIX_SONKU_EXPERIMENTAL_P95_MUSICAL_PRESENCE AND
NOT ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT)
message(FATAL_ERROR "P9.5 requires P9 measured spatial engine")
endif()
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

Expand Down Expand Up @@ -321,7 +328,9 @@ target_compile_definitions(ARMixConsole PRIVATE
$<$<BOOL:${ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT}>:ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT=1>
$<$<BOOL:${ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT}>:SONKU_P90_TRUE_EXTERNAL_RESEARCH=1>
$<$<BOOL:${ARMIX_SONKU_EXPERIMENTAL_P94_FRONT_BACK_DEPTH}>:SONKU_P94_FRONT_BACK_DEPTH_RESEARCH=1>
$<$<BOOL:${ARMIX_SONKU_EXPERIMENTAL_P94_FRONT_BACK_DEPTH}>:ARMIX_SONKU_EXPERIMENTAL_P94_FRONT_BACK_DEPTH=1>)
$<$<BOOL:${ARMIX_SONKU_EXPERIMENTAL_P94_FRONT_BACK_DEPTH}>:ARMIX_SONKU_EXPERIMENTAL_P94_FRONT_BACK_DEPTH=1>
$<$<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>)
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 @@ -848,6 +857,17 @@ if(BUILD_TESTING)
"$<TARGET_FILE:ARMixSonKuP94ReferenceTests>"
"$<TARGET_FILE:ARMixSonKuP94SourceTests>")
endif()
if(ARMIX_SONKU_EXPERIMENTAL_P95_MUSICAL_PRESENCE)
add_executable(ARMixSonKuP95MusicTests
tests/sonku_p95_musical_presence_source_test.cpp)
target_compile_features(ARMixSonKuP95MusicTests PRIVATE cxx_std_20)
target_compile_definitions(ARMixSonKuP95MusicTests PRIVATE
$<TARGET_PROPERTY:ARMixSonKuP91P92MusicBassTests,COMPILE_DEFINITIONS>
SONKU_P94_FRONT_BACK_DEPTH_RESEARCH=1
SONKU_P95_MUSICAL_PRESENCE_RESEARCH=1)
add_test(NAME NativeSonKuP95MusicPresenceVenue
COMMAND ARMixSonKuP95MusicTests)
endif()
juce_add_console_app(ARMixSonKuP90NativeTests
PRODUCT_NAME "ArSonMix SonKu P90 JUCE v11 State Tests")
target_sources(ARMixSonKuP90NativeTests PRIVATE
Expand Down
28 changes: 28 additions & 0 deletions docs/SONKU_P95_IMMERSIVE_MUSIC_VENUE_FAT_20261116.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# SonKu P9.5 Immersive Music & Venue — acceptance and architecture (2026-11-16)

**PRIVATE DRAFT: no public release, no claim of dearVR acoustic parity.**

## Operator sound reference
The operator likes P9.1/P9.2 **music fidelity, real separation and living external sound** but wants deeper front/back and a much larger sound-system presentation, with powerful yet controlled bass. Reference screenshot settings: P9.4 mode, 6.5 s orbit, 82° spread, MIX 100%, GAIN +7dB, LARGE room 28.8×28.8m, distance 3.1m, reflections 100%, reverb 62%, plus rear/front distance concern. This is the starting reference, **not** a verified universal optimum.

## Protected checkpoints
- Operator-accepted P9.1/P9.2: `763706a15a2617a10d23b5e2e43eb5689e454ccb` checkpoint issue #720
- GUI-only PR #721 retains 148×83 *visual perspective ellipse* as the correct 3D view.
- P9.4 PR #723 provides real measured KEMAR source with bounded median-plane DRR adjustment; no claim of measured individual BRIR.
- P9.5 is an isolated child branch. No merge into main without headphone FAT.

## P9.5 implemented engineering
1. **Bypass animation** — the JS visual PLL stops integrating when accepted native FX state is OFF / RACK OFF / UNKNOWN. Discard stale observed azimuth on disable. Do not reset to 0 on every 250ms readback. Resume only from current native telemetry; freeze visual pose while audio callback bypassed. Native FX rack remains sole audio authority.
2. **One latest-engine selector** — no confusing P8.4/P8.9/P9.0/P9.4 research catalog for a P9.5-capable build; legacy saved mode can be displayed honestly as legacy session and switched to latest by explicit operator action, never silently rewritten.
3. **Factory scenes** — five deliberate starting points, full native setting transaction + ACK/readback, editable afterwards: Signature 3.1m/100% ER/62% late/+5.6dB (1.9x linear), Large Studio 4.8m/94% ER/72% late/+4.3dB, Cinema 7.5m/100% ER/84% late/+4.6dB, Venue 10m/100% ER/100% late/+5.1dB, Live Orbit 6.5m/100% ER/83% late/+4.9dB. All use the physical LARGE 28.8m room model, **not claimed as distinct new BRIR measurements or individually different architectural room designs**. Old SMALL/CHAMBER values remain in the schema for session compatibility.
4. **Default only for NEW P9.5 inserts** — initialize `accepted_` with Signature rather than 1.6m/ROOM OFF/outputTrim .75. `.smix` restore applies saved exact settings. Other experimental/production builds unchanged.
5. **Slow electrical music-presence compensation (opt-in)** — 280ms stereo energy detector, 450ms smoothing of the makeup, update desired max once per 256 PCM samples, upward-only target 1.0..1.65. A near-1dB electrical minimum is a **target, not guaranteed loudness** with strong transients. Never reduce explicitly requested positive GAIN. Existing linked 0.98 sample peak limiter remains, peak safety comes before any claiming of dynamic improvement. P9.5 only, no WebAudio, heap, second graph, or front/rear geometry changes. Force bypass at 0% mix.
6. **Large venue low-frequency foundation** — existing three finite-Q room modes increase by at most 18% on the ROOM=Large wet modal return, *not* on direct bass; no fake subwoofer box or hidden low shelf. Bass/treble integrity and attack must survive field tests.
7. **No new .smix schema**: mode9 and typed native settings remain the same, new feature advertised only by `p95MusicalPresence` readback. Existing saved state is authoritative.

## FAT / reject
- Linux source P9, P9.1/P9.2, P9.4 baseline PCM checks, P9.5 44.1/48k and stereo anti-phase, 64/256 buffer parity; UI Chromium with bypass motion freeze and 5 scene transaction/readback.
- Windows actual JUCE + V11 state ACK, GUI portable, checks / source provenance. No release until operator listens.
- Critical loudness: equal-gain A/B and user-preferred +gain A/B are **separate**. Compare integrated loudness, short-term crest factor and limiter activity; do NOT select louder just because it wins unblinded A/B.
- Headphones, same device / gain path / speaker fader / source, actual 0/90/180/270 and 6–12 second orbit, 3.1m/7.5m/10m; compare bass drum punch, 50–120Hz notes, cymbal air and stereo music separation. Retain P9.1/P9.2 baseline for quick revert. Reject if boost causes pumping, peak flatlining, harshness, mono collapse, spurious echoes, or ASIO interruptions.
- Important known ceiling: these five named scenes still share existing native large-room geometry and algorithm. True physically distinct cinema/venue BRIRs need new early-reflection geometry, materials, speaker directivity, and listening measurements. Label this as a FOUNDATION, not completed dearVR equivalent.
20 changes: 19 additions & 1 deletion engine/builtin_fx/SonKuSpatialProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,25 @@ class SonKuSpatialProcessor final : public juce::AudioProcessor,
SonKuSpatialProcessor()
: juce::AudioProcessor(BusesProperties()
.withInput("Input",juce::AudioChannelSet::stereo(),true)
.withOutput("Output",juce::AudioChannelSet::stereo(),true)) {}
.withOutput("Output",juce::AudioChannelSet::stereo(),true)) {
#if defined(ARMIX_SONKU_EXPERIMENTAL_P95_MUSICAL_PRESENCE) && ARMIX_SONKU_EXPERIMENTAL_P95_MUSICAL_PRESENCE
// NEW inserts only. Restore from an existing .smix uses its saved
// settings verbatim; no automatic remapping of operator sessions.
// Signature reference is the operator's immersive 3.1m / full first
// reflection / 62% reverb scene with conservative native linked guard.
accepted_.renderMode=9;
accepted_.musicCompatibleLowFrequency=false;
accepted_.moving=true;
accepted_.revolutionSeconds=6.5f;
accepted_.stereoSpreadDegrees=82.f;
accepted_.spatialMix=1.f;
accepted_.outputTrim=1.9f;
accepted_.spacePreset=3;
accepted_.sourceDistanceMeters=3.1f;
accepted_.roomAmount=1.f;
accepted_.ambience=.62f;
#endif
}
const juce::String getName() const override {return "8D-SonKu";}
bool acceptsMidi() const override {return false;}
bool producesMidi() const override {return false;}
Expand Down
11 changes: 10 additions & 1 deletion engine/builtin_fx/sonku/SonKuP91P92WorldBassFoundation.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,16 @@ class WorldBassFoundation final {
auto& resonator=resonators_[r][b];
const float l=resonator.state[0].run(resonator.coeff,world[0]);
const float rr=resonator.state[1].run(resonator.coeff,world[1]);
const float level=roomWeights_[r]*roomGain_*modeWeights[b];
// Private P9.5 venue reinforcement: augment the EXISTING
// low-frequency axial room modes slightly, not the direct
// bass, not a duplicate cabinet engine or hard EQ shelf.
// All modes remain damping-controlled with finite Q.
#if defined(SONKU_P95_MUSICAL_PRESENCE_RESEARCH) && SONKU_P95_MUSICAL_PRESENCE_RESEARCH
const float venue=roomPreset==3?1.18f:1.f;
#else
constexpr float venue=1.f;
#endif
const float level=roomWeights_[r]*roomGain_*modeWeights[b]*venue;
modal.left+=level*l;
modal.right+=level*rr;
}
Expand Down
46 changes: 46 additions & 0 deletions engine/builtin_fx/sonku/SonKuP95MusicalPresence.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// SPDX-License-Identifier: AGPL-3.0-only
#pragma once
#include <algorithm>
#include <cmath>

// Optional single-graph music-level *upward-only* compensation.
// In P9 spatial wet transforms the original stereo energy can be lower.
// A slow detector allows a conservative minimum electrical level without
// turning the entire effect into a compressor or defeating user gain.
// The final existing linked 0.98 sample peak safety limiter stays authoritative.
namespace armix::sonku::p95 {
class MusicalPresence final {
public:
bool prepare(double sr) noexcept {
if(!std::isfinite(sr) || (std::abs(sr-44100.)>.1 && std::abs(sr-48000.)>.1))
return false;
detector_=static_cast<float>(1.-std::exp(-1./(sr*.28)));
slew_=static_cast<float>(1.-std::exp(-1./(sr*.45)));
reset();return true;
}
void reset() noexcept {inPower_=outPower_=0.f;target_=makeup_=1.f;counter_=0;}
float process(float inL,float inR,float wetL,float wetR) noexcept {
const float a=.5f*(inL*inL+inR*inR);
const float b=.5f*(wetL*wetL+wetR*wetR);
inPower_+=detector_*(a-inPower_);
outPower_+=detector_*(b-outPower_);
// At most one square root per 256 samples, outside inner FIR loops.
if(++counter_>=256){
counter_=0;
if(inPower_>1.e-7f&&outPower_>1.e-9f){
const float ratio=std::sqrt(inPower_/outPower_);
// 1.12× = +0.98dB *electrical* minimum when possible.
// Never auto-reduce the deliberate user outputTrim boost.
target_=std::clamp(1.12f*ratio,1.f,1.65f);
}else target_=1.f;
}
makeup_+=slew_*(target_-makeup_);
return makeup_;
}
float gain() const noexcept {return makeup_;}
private:
float detector_=0.f,slew_=0.f,inPower_=0.f,outPower_=0.f;
float target_=1.f,makeup_=1.f;
int counter_=0;
};
} // namespace armix::sonku::p95
Loading
Loading