From: Rudolf Polzer Date: Wed, 28 Sep 2011 07:05:01 +0000 (+0200) Subject: improve pitch shift combining to have equal RMS at any pitch X-Git-Tag: xonotic-v0.6.0~40^2~106^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9b365e72adacd650b9d5af2515ef652017cf79ec;p=xonotic%2Fxonotic-data.pk3dir.git improve pitch shift combining to have equal RMS at any pitch --- diff --git a/qcsrc/client/tuba.qc b/qcsrc/client/tuba.qc index 379f9c675..7a29154d6 100644 --- a/qcsrc/client/tuba.qc +++ b/qcsrc/client/tuba.qc @@ -47,11 +47,11 @@ void tubasound(entity e, float restart) { if(restart) snd1 = TUBA_STARTNOTE(e.note - m); - f1 = 1 - m / Tuba_PitchStep; + f1 = cos(M_PI_2 * m / Tuba_PitchStep); p1 = pow(2.0, m / 12.0); if(restart) snd2 = TUBA_STARTNOTE(e.note - m + Tuba_PitchStep); - f2 = m / Tuba_PitchStep; + f2 = sin(M_PI_2 * m / Tuba_PitchStep); p2 = pow(2.0, (m - Tuba_PitchStep) / 12.0); } }