[Scummvm-cvs-logs] CVS: scummvm/sound mididrv.cpp,1.20,1.21

James Brown ender at users.sourceforge.net
Tue May 7 22:34:02 CEST 2002


Update of /cvsroot/scummvm/scummvm/sound
In directory usw-pr-cvs1:/tmp/cvs-serv25021/sound

Modified Files:
	mididrv.cpp 
Log Message:
Add possible code for Modulation/Sustain to Emulated Midi Driver



Index: mididrv.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mididrv.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- mididrv.cpp	7 May 2002 22:07:28 -0000	1.20
+++ mididrv.cpp	8 May 2002 05:32:59 -0000	1.21
@@ -1153,12 +1153,42 @@
 	break;
 
 	case 0xb0: { /* control change .. pitch bend? */
+		int i;
 		unsigned char ctrl = (unsigned char)((b >> 8) & 0x7F);
 		unsigned char vel = (unsigned char)((b >> 16) & 0x7F);
 
-                switch(ctrl) {
-		case 0x07:
+		/* FIXME: Except for Volume, the Modulation and Sustain
+				  code is just a random guess. */
+        switch(ctrl) {
+		case 0x01:	/* Modulation */
+			for (i = 0; i < 9; i++)
+				if (chp[i][0] == channel)
+					midi_write_adlib(0x20 + adlib_opadd[i], vel);
+			break;
+		case 0x07:	/* Volume */
 			ch[channel].vol = vel;
+			break;
+		case 0x0A:	/* Pan */
+			debug(1, "MIDI sub-command 0xB0 (Key After Touch) case %02X (Pan) not handled in MIDIEMU driver.", ctrl);
+			break;
+		case 0x40:	/* Sustain on/off */
+			for (i = 0; i < 9; i++)
+				if (chp[i][0] == channel)
+					midi_write_adlib(0x80 + adlib_opadd[i], vel);
+			break;
+		case 0x5B:	/* Extended depth effect */
+			debug(1, "MIDI sub-command 0xB0 (Key After Touch) case %02X (Extended Depth) not handled in MIDIEMU driver.", ctrl);
+			break;
+		case 0x5D:	/* Chorus depth */
+			debug(1, "MIDI sub-command 0xB0 (Key After Touch) case %02X (Chorus Depth) not handled in MIDIEMU driver.", ctrl);
+			break;
+		case 0x7B: 	/* All notes off */
+			for (i = 0; i < 9; i++) {
+				if (chp[i][0] == channel) {
+					midi_fm_endnote(i);
+					chp[i][0] = -1;
+				}
+			}
 			break;
 		default:
 			debug(1, "MIDI sub-command 0xB0 (Key After Touch) case %02X not handled in MIDIEMU driver.", ctrl);





More information about the Scummvm-git-logs mailing list