]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
improve pitch shift combining to have equal RMS at any pitch
authorRudolf Polzer <divVerent@xonotic.org>
Wed, 28 Sep 2011 07:05:01 +0000 (09:05 +0200)
committerRudolf Polzer <divVerent@xonotic.org>
Wed, 28 Sep 2011 07:05:01 +0000 (09:05 +0200)
qcsrc/client/tuba.qc

index 379f9c675057222e439e4d2077b1a67fb2a4216f..7a29154d66827c88bad2d7a70d54e225b22acd88 100644 (file)
@@ -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);
                        }
                }