aboutsummaryrefslogtreecommitdiff
path: root/audio/softsynth/mt32
diff options
context:
space:
mode:
authorFilippos Karapetis2013-03-27 23:01:47 +0200
committerFilippos Karapetis2013-03-27 23:01:47 +0200
commit3f01f34b1fa7efaccbcfc32c5ce97515a80eb12e (patch)
tree2d9a9c74858bb83eddad6754550b8aff3c42852c /audio/softsynth/mt32
parentf8b1a16e3c10580f7945fd36149b6f1d2a277753 (diff)
downloadscummvm-rg350-3f01f34b1fa7efaccbcfc32c5ce97515a80eb12e.tar.gz
scummvm-rg350-3f01f34b1fa7efaccbcfc32c5ce97515a80eb12e.tar.bz2
scummvm-rg350-3f01f34b1fa7efaccbcfc32c5ce97515a80eb12e.zip
MT-32: Sync with the latest changes in munt
This syncs our code with munt commit 15e9f65
Diffstat (limited to 'audio/softsynth/mt32')
-rw-r--r--audio/softsynth/mt32/LA32WaveGenerator.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/audio/softsynth/mt32/LA32WaveGenerator.cpp b/audio/softsynth/mt32/LA32WaveGenerator.cpp
index 5b2c9001b8..80650699fb 100644
--- a/audio/softsynth/mt32/LA32WaveGenerator.cpp
+++ b/audio/softsynth/mt32/LA32WaveGenerator.cpp
@@ -32,10 +32,10 @@ static const LogSample SILENCE = {65535, LogSample::POSITIVE};
Bit16u LA32Utilites::interpolateExp(const Bit16u fract) {
Bit16u expTabIndex = fract >> 3;
- Bit16u extraBits = fract & 7;
+ Bit16u extraBits = ~fract & 7;
Bit16u expTabEntry2 = 8191 - Tables::getInstance().exp9[expTabIndex];
Bit16u expTabEntry1 = expTabIndex == 0 ? 8191 : (8191 - Tables::getInstance().exp9[expTabIndex - 1]);
- return expTabEntry1 + (((expTabEntry2 - expTabEntry1) * extraBits) >> 3);
+ return expTabEntry2 + (((expTabEntry1 - expTabEntry2) * extraBits) >> 3);
}
Bit16s LA32Utilites::unlog(const LogSample &logSample) {
@@ -55,7 +55,6 @@ void LA32Utilites::addLogSamples(LogSample &logSample1, const LogSample &logSamp
Bit32u LA32WaveGenerator::getSampleStep() {
// sampleStep = EXP2F(pitch / 4096.0f + 4.0f)
Bit32u sampleStep = LA32Utilites::interpolateExp(~pitch & 4095);
- sampleStep &= ~1;
sampleStep <<= pitch >> 12;
sampleStep >>= 8;
sampleStep &= ~1;
@@ -240,7 +239,7 @@ void LA32WaveGenerator::generateNextPCMWaveLogSamples() {
} else {
secondPCMLogSample = SILENCE;
}
- // pcmSampleStep = EXP2F(pitch / 4096. - 5.);
+ // pcmSampleStep = (Bit32u)EXP2F(pitch / 4096.0f + 3.0f);
Bit32u pcmSampleStep = LA32Utilites::interpolateExp(~pitch & 4095);
pcmSampleStep <<= pitch >> 12;
// Seeing the actual lengths of the PCM wave for pitches 00..12,