aboutsummaryrefslogtreecommitdiff
path: root/audio/softsynth/mt32.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2013-05-17 00:26:03 +0200
committerJohannes Schickel2013-05-17 00:40:34 +0200
commita1cfe235e4d148b5ee8673eb85b70e3b7ffbf095 (patch)
tree5fc66605754c9033db1a387c4259629e2ee67288 /audio/softsynth/mt32.cpp
parenta29eb151e013d7c645b6ca7e2c6e5b8117bc3353 (diff)
downloadscummvm-rg350-a1cfe235e4d148b5ee8673eb85b70e3b7ffbf095.tar.gz
scummvm-rg350-a1cfe235e4d148b5ee8673eb85b70e3b7ffbf095.tar.bz2
scummvm-rg350-a1cfe235e4d148b5ee8673eb85b70e3b7ffbf095.zip
AUDIO: Reduce callback frequency of the MT-32 emulator.
Formerly the frequency was at 10000Hz. This resulted in 3,4 or even only 1 sample to be generated between callbacks on my system. All the other MIDI drivers use a much lower frequency here. The MidiDriver_Emulated subclasses use a frequency of 250Hz (by default) and the MidiDriver_MPU401 subclasses (which are for example the ALSA output) use 100Hz. With the new frequency of 250Hz 128 samples are generated between callbacks. This will hopefully reduce the overhead of the MT-32 emulator (the engine's code was run 10000 times a second too) a bit. I talked with KingGuppy and it seems the value was increased in the past (still with the very old MT-32 emulator code) because there were accuracy issues. However, I gave the lower frequency a quick test with the MI1, MI2 and ITE intro and didn't spot any obvious differences. As a result, KingGuppy and I agreed to lower it back to 250Hz. If there are any problems coming up we can still slightly increase the frequency to 1000Hz for example. Thanks to waltervn for noticing this. Thanks to KingGuppy for discussion.
Diffstat (limited to 'audio/softsynth/mt32.cpp')
-rw-r--r--audio/softsynth/mt32.cpp4
1 files changed, 0 insertions, 4 deletions
diff --git a/audio/softsynth/mt32.cpp b/audio/softsynth/mt32.cpp
index 3ae8e14b36..00d0469356 100644
--- a/audio/softsynth/mt32.cpp
+++ b/audio/softsynth/mt32.cpp
@@ -147,10 +147,6 @@ MidiDriver_MT32::MidiDriver_MT32(Audio::Mixer *mixer) : MidiDriver_Emulated(mixe
}
_reportHandler = NULL;
_synth = NULL;
- // A higher baseFreq reduces the length used in generateSamples(),
- // and means that the timer callback will be called more often.
- // That results in more accurate timing.
- _baseFreq = 10000;
// Unfortunately bugs in the emulator cause inaccurate tuning
// at rates other than 32KHz, thus we produce data at 32KHz and
// rely on Mixer to convert.