[Scummvm-cvs-logs] SF.net SVN: scummvm: [28657] scummvm/trunk/engines/agi

buddha_ at users.sourceforge.net buddha_ at users.sourceforge.net
Sat Aug 18 17:54:30 CEST 2007


Revision: 28657
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28657&view=rev
Author:   buddha_
Date:     2007-08-18 08:54:29 -0700 (Sat, 18 Aug 2007)

Log Message:
-----------
Changed Apple IIGS sample playing frequency multiplier from 1076.0 to C6 (i.e. about 1046.5). Commented out a warning that comes too often.

Modified Paths:
--------------
    scummvm/trunk/engines/agi/sound.cpp
    scummvm/trunk/engines/agi/sound.h

Modified: scummvm/trunk/engines/agi/sound.cpp
===================================================================
--- scummvm/trunk/engines/agi/sound.cpp	2007-08-18 12:41:24 UTC (rev 28656)
+++ scummvm/trunk/engines/agi/sound.cpp	2007-08-18 15:54:29 UTC (rev 28657)
@@ -639,7 +639,7 @@
 		if (playingSound != -1) {
 			if (_vm->_game.sounds[playingSound]->type() == AGI_SOUND_MIDI) {
 				/* play_midi_sound (); */
-				warning("playSound: Trying to play an Apple IIGS MIDI sound. Not yet implemented!");
+				//warning("playSound: Trying to play an Apple IIGS MIDI sound. Not yet implemented!");
 				playing = 0;
 			} else if (_vm->_game.sounds[playingSound]->type() == AGI_SOUND_SAMPLE) {
 				//debugC(3, kDebugLevelSound, "playSound: Trying to play an Apple IIGS sample");
@@ -687,8 +687,11 @@
 		//double hertz = 8.175798915644 * pow(SEMITONE, fracToDouble(chn.note));
 		// double step = getRate() / hertz;
 		// chn.posAdd = doubleToFrac(step);
-
-		double hertz = 1076.0 * pow(SEMITONE, fracToDouble(chn.note));
+		
+		// Frequency multiplier was 1076.0 based on tests made with MESS 0.117.
+		// Tests made with KEGS32 averaged the multiplier to around 1045.
+		// So this is a guess but maybe it's 1046.5... i.e. C6's frequency?
+		double hertz = C6_FREQ * pow(SEMITONE, fracToDouble(chn.note));
 		chn.posAdd = doubleToFrac(hertz / getRate());
 		chn.vol = doubleToFrac(fracToDouble(chn.envVol) * fracToDouble(chn.chanVol) / 127.0);
 		double tempVol = fracToDouble(chn.vol)/127.0;

Modified: scummvm/trunk/engines/agi/sound.h
===================================================================
--- scummvm/trunk/engines/agi/sound.h	2007-08-18 12:41:24 UTC (rev 28656)
+++ scummvm/trunk/engines/agi/sound.h	2007-08-18 15:54:29 UTC (rev 28657)
@@ -66,6 +66,10 @@
 // 2**(1/12) i.e. the 12th root of 2
 #define SEMITONE 1.059463094359295
 
+// C6's frequency is A4's (440 Hz) frequency but one full octave and three semitones higher
+// i.e. C6_FREQ = 440 * pow(2.0, 15/12.0)
+#define C6_FREQ 1046.502261202395
+
 // Size of the SIERRASTANDARD file (i.e. the wave file i.e. the sample data used by the instruments).
 #define SIERRASTANDARD_SIZE 65536
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list