Clamp X1-010 Envelope wave

This commit is contained in:
cam900 2022-03-12 11:32:19 +09:00 committed by GitHub
parent 00109dc276
commit 2643d6b0ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -323,9 +323,15 @@ void DivPlatformX1_010::updateEnvelope(int ch) {
}
if (chan[ch].env.flag.envVinvR) { ro=15-ro; } // vertical invert right envelope
if (chan[ch].env.flag.envVinvL) { lo=15-lo; } // vertical invert left envelope
if (lo<0) lo=0;
if (lo>15) lo=15;
if (ro<0) ro=0;
if (ro>15) ro=15;
envWrite(ch,i,lo,ro);
} else {
int out=wt->data[i*wt->len/128]*15/wt->max;
if (out<0) out=0;
if (out>15) out=15;
envWrite(ch,i,out,out);
}
}