I've been modding BF sound scripts for a long time and it seems I've finally encountered a nasty problem with volume-distance ramps I can't solve on my own and have to ask for help

I'm familiar with Senshi/Kerfuffle SSC scripting deep-dives, but their posts don't go deep enough into distance ramps. Initially, I though I messed up my game/eax settings or RFAs, but after experimenting with vanilla game for two days I think I've pinpointed the particular issue.
For the context, I usually set minDistance to the sound termination distance specified in one of the volume ramps (-1), because I don't want rolloff interfering with my volume fade fine-tuning. Even though this usually works, with certain ramp combinations the game seems to ignore my fading ramp. It's best explained with the following code sample, which modifies the last barmlp.wav patch in vanilla Objects/HandWeapons/Bar1918/Sounds/High.ssc:
Code: Select all
load @ROOT/Sound/@RTD/barmlp.wav
minDistance 100 <--- my only change in "header" section, other commands are just for context
loop
stop FinishSample
dopplerOff
priority 8
randomStartPitch 0.02 / 0.01
*** changes begin here ***
beginEffect
controlDestination Volume
controlSource Distance
envelope Ramp
param 10
param 10
param 0
param 1 <--- changing this to 0.1 lowers the initial volume; distance fade works OK
endEffect
beginEffect
controlDestination Volume
controlSource Distance
envelope Ramp
param 10
param 100
param 1 <--- seems to act as a multiplier for the volume value at distance specified by 1st parameter,
i.e. setting 0.5 to both this param and the 4th param in previous ramp results in
initial volume of 0.5 * 0.5 = 0.25 at 10 meters.
Though, bear in mind that Ramp fading is probably not linear, so
"multiplying" initial volume 1.0 by 0.1 will result in much more aggressive fading curve
than 0.1 "multiplied" by 1
param -1
endEffect
However, if you replace the second ramp with the following two ramps, the behaviour will be incorrect:
Code: Select all
beginEffect
controlDestination Volume
controlSource Distance
envelope Ramp
param 10
param 100
param 1
param 0.1 <--- this value (and distance fade as a consequence)
is completely ignored by the game, as if
the next volume ramp overrides/overwrites this one
with whatever initial volume is specified there
endEffect
beginEffect
controlDestination Volume
controlSource Distance
envelope Ramp
param 100
param 100
param 1 <--- virtually any value here seems to override distance fade
from the previous ramp, so with value 1 the volume stays at 1
across the whole 10-100 range until termination
param -1
endEffect
Code: Select all
beginEffect
controlDestination Volume
controlSource Distance
envelope Ramp
param 1
param 50
param 0
param 1 <--- setting to other values seems to work as expected
endEffect
beginEffect
controlDestination Volume
controlSource Distance
envelope Ramp
param 50
param 100
param 1
param -1
endEffect

If someone wants to reproduce it, I can provide a tweak for soldier fixed/external camera view and my sandbox map I used for testing this