[Scummvm-cvs-logs] CVS: scummvm/scumm imuse.cpp,2.128,2.129 instrument.cpp,2.31,2.32 instrument.h,2.14,2.15

Eugene Sandulenko sev at users.sourceforge.net
Tue Apr 12 15:42:24 CEST 2005


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11171

Modified Files:
	imuse.cpp instrument.cpp instrument.h 
Log Message:
Patch #1180882 "GM/GS Percussion Remapping"


Index: imuse.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse.cpp,v
retrieving revision 2.128
retrieving revision 2.129
diff -u -d -r2.128 -r2.129
--- imuse.cpp	2 Apr 2005 13:58:00 -0000	2.128
+++ imuse.cpp	12 Apr 2005 22:41:24 -0000	2.129
@@ -1531,8 +1531,14 @@
 		mc = _player->getMidiDriver()->getPercussionChannel();
 		if (!mc)
 			return;
-		mc->volume(_vol_eff);
-//		mc->programChange(_bank);
+  		static byte prev_vol_eff = 128;
+		if (_vol_eff != prev_vol_eff){
+			mc->volume(_vol_eff);
+			prev_vol_eff = _vol_eff;
+		}
+		if ((note < 35) && (!_player->_se->isNativeMT32()))
+			note = Instrument::_gmRhythmMap[note];
+
 		mc->noteOn(note, velocity);
 	}
 }

Index: instrument.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/instrument.cpp,v
retrieving revision 2.31
retrieving revision 2.32
diff -u -d -r2.31 -r2.32
--- instrument.cpp	3 Apr 2005 22:01:25 -0000	2.31
+++ instrument.cpp	12 Apr 2005 22:41:25 -0000	2.32
@@ -114,6 +114,15 @@
 //	{ "trickle4  ", ??? }
 };
 
+const byte Instrument::_gmRhythmMap[35] = {
+	  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+	  0,  0,  0,  0,  0,  0,  0,  0, 36, 37, 38, 39, 40, 41, 66, 47,
+	 65, 48, 56}; 
+       // This emulates the percussion bank setup LEC used with the MT-32,
+       // where notes 24 - 34 were assigned instruments without reverb.
+       // It also fixes problems on GS devices that map sounds to these
+       // notes by default.
+
 class Instrument_Program : public InstrumentInternal {
 private:
 	byte _program;

Index: instrument.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/instrument.h,v
retrieving revision 2.14
retrieving revision 2.15
diff -u -d -r2.14 -r2.15
--- instrument.h	7 Jan 2005 14:42:51 -0000	2.14
+++ instrument.h	12 Apr 2005 22:41:25 -0000	2.15
@@ -57,6 +57,7 @@
 	Instrument() : _type (0), _instrument (0) { }
 	~Instrument() { delete _instrument; }
 	static void nativeMT32 (bool native);
+	static const byte _gmRhythmMap[35];
 
 	void clear();
 	void copy_to (Instrument *dest) { if (_instrument) _instrument->copy_to (dest); else dest->clear(); }





More information about the Scummvm-git-logs mailing list