change software clipping range

some ASIO drivers overflow when given a 1.0 or -1.0 sample.
this changes the range to -0.9999 - 0.9999, which prevents overflow
with imperceptible impact on output.
This commit is contained in:
tildearrow 2025-10-26 02:25:24 -05:00
parent 54a2507780
commit 808523b9c6

View file

@ -3394,8 +3394,8 @@ void DivEngine::nextBuf(float** in, float** out, int inChans, int outChans, unsi
if (clampSamples) {
for (size_t i=0; i<size; i++) {
for (int j=0; j<outChans; j++) {
if (out[j][i]<-1.0) out[j][i]=-1.0;
if (out[j][i]>1.0) out[j][i]=1.0;
if (out[j][i]<-0.9999) out[j][i]=-0.9999;
if (out[j][i]>0.9999) out[j][i]=0.9999;
}
}
}