diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/mods/maxtrax.cpp | 10 | ||||
-rw-r--r-- | sound/mods/maxtrax.h | 1 |
2 files changed, 2 insertions, 9 deletions
diff --git a/sound/mods/maxtrax.cpp b/sound/mods/maxtrax.cpp index 4f863ee7ba..e53099e480 100644 --- a/sound/mods/maxtrax.cpp +++ b/sound/mods/maxtrax.cpp @@ -165,13 +165,6 @@ void MaxTrax::interrupt() { } -int32 MaxTrax::omgItsAntiLog(uint32 val) { - // some really weird exponential function, and some also very nonstandard "standard format" floats - // format is 16? bit exponent, 16 bit mantissa. and we need to scale with log(2) - const float v = ldexp((float)((val & 0xFFFF) + 0x10000) * (float)(0.69314718055994530942 / 65536), val >> 16); - return (uint32)exp(v); -} - void MaxTrax::stopMusic() { } @@ -249,7 +242,8 @@ int MaxTrax::calcNote(VoiceContext &voice) { tone -= voice.periodOffset; } if (tone < PERIOD_LIMIT) - voice.lastPeriod = (uint16)omgItsAntiLog((float)tone); + // we need to scale with log(2) + voice.lastPeriod = (uint16)exp((float)tone * (float)(0.69314718055994530942 / 65536)); return octave; } diff --git a/sound/mods/maxtrax.h b/sound/mods/maxtrax.h index 3efed92954..bc04ad6246 100644 --- a/sound/mods/maxtrax.h +++ b/sound/mods/maxtrax.h @@ -205,7 +205,6 @@ public: void freePatches(); void freeScores(); - static int32 omgItsAntiLog(uint32 val); int calcNote(VoiceContext &voice); int8 noteOn(ChannelContext &channel, byte note, uint16 volume, uint16 pri); void noteOff(ChannelContext &channel, byte note); |