From 9cfc995aa0a7e41e8d5c2e81882347c0d4b925a6 Mon Sep 17 00:00:00 2001 From: Jage9 Date: Sun, 22 Feb 2026 21:45:40 -0500 Subject: [PATCH] Smooth directional off-axis attenuation curve --- client/public/version.js | 2 +- client/src/audio/spatial.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/client/public/version.js b/client/public/version.js index 619caf5..879280b 100644 --- a/client/public/version.js +++ b/client/public/version.js @@ -1,5 +1,5 @@ // Maintainer-controlled web client version. // Format: YYYY.MM.DD Rn (example: 2026.02.20 R2) -window.CHGRID_WEB_VERSION = "2026.02.22 R194"; +window.CHGRID_WEB_VERSION = "2026.02.22 R195"; // Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid. window.CHGRID_TIME_ZONE = "America/Detroit"; diff --git a/client/src/audio/spatial.ts b/client/src/audio/spatial.ts index b24ff7b..e81cd06 100644 --- a/client/src/audio/spatial.ts +++ b/client/src/audio/spatial.ts @@ -111,7 +111,8 @@ function resolveDirectionalProfile( return { attenuationFactor: 1, offAxisRatio: 0 }; } const span = Math.max(1, 180 - halfCone); - const offAxisRatio = Math.max(0, Math.min(1, (diff - halfCone) / span)); + const linearRatio = Math.max(0, Math.min(1, (diff - halfCone) / span)); + const offAxisRatio = linearRatio * linearRatio * (3 - 2 * linearRatio); return { attenuationFactor: 1 - offAxisRatio * (1 - rearGain), offAxisRatio,