[Scummvm-cvs-logs] CVS: scummvm/sound mididrv.cpp,1.7,1.8

Max Horn fingolfin at users.sourceforge.net
Sun Sep 29 11:28:03 CEST 2002


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

Modified Files:
	mididrv.cpp 
Log Message:
temporary pitch bend fix for the QuickTime midi driver. not quite perfect... hrm

Index: mididrv.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mididrv.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- mididrv.cpp	29 Sep 2002 11:11:42 -0000	1.7
+++ mididrv.cpp	29 Sep 2002 18:27:48 -0000	1.8
@@ -665,7 +665,11 @@
 		break;
 
 	case 0xE0:{									// Pitch bend
-			long theBend = ((((long)midiCmd[1] + (long)(midiCmd[2] << 8))) - 0x4000) / 4;
+			long theBend = (long)midiCmd[1] | (long)(midiCmd[2] << 8);
+			// QuickTime specifies pitchbend in semitones, using 8.8 fixed point values;
+			// but iMuse sends us the pitch bend data relative to +/- 12 semitones. Thus
+			// we have to convert it to the QT format.
+			theBend = (theBend - 0x4000) * 6 / 128;
 			NASetController(qtNoteAllocator, qtNoteChannel[chanID], kControllerPitchBend, theBend);
 		}
 		break;





More information about the Scummvm-git-logs mailing list