From 5cc2696deb01041b71e3deaf9f6747f75470d24b Mon Sep 17 00:00:00 2001 From: jepael Date: Wed, 7 Sep 2016 23:22:18 +0300 Subject: AUDIO: Fix CMS chips incorrect pitch. The CMS emulation assumes the chips run at 8 MHz clock, but in PCs they run at 7.15909 MHz, so the emulated pitch is too high. Adjusting the requested sampling rate higher by matching amount the pitch is lowered down to normal. --- audio/softsynth/cms.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/audio/softsynth/cms.h b/audio/softsynth/cms.h index 8c0f980b0a..64df30e037 100644 --- a/audio/softsynth/cms.h +++ b/audio/softsynth/cms.h @@ -68,7 +68,9 @@ struct SAA1099 { class CMSEmulator { public: CMSEmulator(uint32 sampleRate) { - _sampleRate = sampleRate; + // In PCs the chips run at 7.15909 MHz instead of 8 MHz. + // Adjust sampling rate upwards to bring pitch down. + _sampleRate = (sampleRate * 352) / 315; memset(_saa1099, 0, sizeof(SAA1099)*2); } -- cgit v1.2.3