[Scummvm-cvs-logs] CVS: scummvm/sky gmchannel.cpp,1.2,1.3 gmchannel.h,1.2,1.3 gmmusic.cpp,1.2,1.3 sky.cpp,1.33,1.34
Robert G?ffringmann
lavosspawn at users.sourceforge.net
Thu May 15 12:13:14 CEST 2003
Update of /cvsroot/scummvm/scummvm/sky
In directory sc8-pr-cvs1:/tmp/cvs-serv31207/sky
Modified Files:
gmchannel.cpp gmchannel.h gmmusic.cpp sky.cpp
Log Message:
added incrementation of key velocity.
Index: gmchannel.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/gmchannel.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- gmchannel.cpp 12 May 2003 23:25:54 -0000 1.2
+++ gmchannel.cpp 15 May 2003 18:56:15 -0000 1.3
@@ -21,6 +21,20 @@
#include "gmchannel.h"
+// the MT32 is a lot more sensitive to velocities than most general midi devices,
+// so we need to boost them a little
+uint8 SkyGmChannel::_veloTab[128] = {
+0x00, 0x30, 0x31, 0x31, 0x32, 0x33, 0x33, 0x34, 0x34, 0x35, 0x36, 0x36, 0x37,
+0x38, 0x38, 0x39, 0x39, 0x3A, 0x3B, 0x3B, 0x3C, 0x3D, 0x3D, 0x3E, 0x3E, 0x3F,
+0x40, 0x40, 0x41, 0x42, 0x42, 0x43, 0x43, 0x44, 0x45, 0x45, 0x46, 0x47, 0x47,
+0x48, 0x48, 0x49, 0x4A, 0x4A, 0x4B, 0x4C, 0x4C, 0x4D, 0x4D, 0x4E, 0x4F, 0x4F,
+0x50, 0x50, 0x51, 0x52, 0x52, 0x53, 0x54, 0x54, 0x55, 0x55, 0x56, 0x57, 0x57,
+0x58, 0x59, 0x59, 0x5A, 0x5A, 0x5B, 0x5C, 0x5C, 0x5D, 0x5E, 0x5E, 0x5F, 0x5F,
+0x60, 0x61, 0x61, 0x62, 0x63, 0x63, 0x64, 0x64, 0x65, 0x66, 0x66, 0x67, 0x68,
+0x68, 0x69, 0x69, 0x6A, 0x6B, 0x6B, 0x6C, 0x6C, 0x6D, 0x6E, 0x6E, 0x6F, 0x70,
+0x70, 0x71, 0x71, 0x72, 0x73, 0x73, 0x74, 0x75, 0x75, 0x76, 0x76, 0x77, 0x78,
+0x78, 0x79, 0x7A, 0x7A, 0x7B, 0x7B, 0x7C, 0x7D, 0x7D, 0x7E, 0x7F };
+
SkyGmChannel::SkyGmChannel(uint8 *pMusicData, uint16 startOfData, MidiDriver *pMidiDrv, byte *pInstMap)
{
_musicData = pMusicData;
@@ -110,8 +124,9 @@
}
} else {
_channelData.note = opcode;
- _midiDrv->send((0x90 | _channelData.midiChannelNumber) | (opcode << 8) | (_musicData[_channelData.eventDataPtr] << 16));
+ uint8 velocity = _veloTab[_musicData[_channelData.eventDataPtr]];
_channelData.eventDataPtr++;
+ _midiDrv->send((0x90 | _channelData.midiChannelNumber) | (opcode << 8) | (velocity << 16));
}
if (_channelData.channelActive)
_channelData.nextEventTime += getNextEventTime();
Index: gmchannel.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/gmchannel.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- gmchannel.h 12 May 2003 23:25:54 -0000 1.2
+++ gmchannel.h 15 May 2003 18:56:15 -0000 1.3
@@ -44,6 +44,7 @@
virtual void updateVolume(uint16 pVolume);
private:
byte *_mt32_to_gm;
+ static uint8 _veloTab[128];
MidiDriver *_midiDrv;
uint8 *_musicData;
uint16 _musicVolume;
Index: gmmusic.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/gmmusic.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- gmmusic.cpp 12 May 2003 23:25:54 -0000 1.2
+++ gmmusic.cpp 15 May 2003 18:56:15 -0000 1.3
@@ -74,12 +74,12 @@
void SkyGmMusic::startDriver(void) {
- _midiDrv->send(0xFF);
+ //_midiDrv->send(0xFF); //ALSA can't handle this.
// skip all sysEx as it can't be handled anyways.
}
-// each section has its own custom instruments setup, so we need one translation table
-// per section. Need an MT32 to make correct tables, though.
+// not sure about these tables. Now it's just 6 copies of jamiesons table in the
+// instruments.cpp, but I still think that there must be something to be done to them.
byte SkyGmMusic::_mt32_to_gm[6*128] = {
// Section 0:
@@ -89,10 +89,9 @@
88, 95, 52, 98, 97, 99, 14, 54, 102, 96, 53, 102, 81, 100, 14, 80, // 2x
48, 48, 49, 45, 41, 40, 42, 42, 43, 46, 45, 24, 25, 28, 27, 104, // 3x
32, 32, 34, 33, 36, 37, 35, 35, 79, 73, 72, 72, 74, 75, 64, 65, // 4x
- 66, 67, 71, 71, 57, 69, 70, 22, 56, 59, 57, 57, 60, 60, 60, 63, // 5x
+ 66, 67, 71, 71, 68, 69, 70, 22, 56, 59, 57, 57, 60, 60, 58, 61, // 5x
61, 11, 11, 98, 14, 9, 14, 13, 12, 107, 107, 77, 78, 78, 76, 76, // 6x
47, 117, 127, 118, 118, 116, 115, 119, 115, 112, 55, 124, 123, 0, 14, 117, // 7x
-
// Section 1:
// 0 1 2 3 4 5 6 7 8 9 A B C D E F
0, 1, 0, 2, 4, 4, 5, 3, 16, 17, 18, 16, 16, 19, 20, 21, // 0x
Index: sky.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/sky.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- sky.cpp 14 May 2003 22:33:39 -0000 1.33
+++ sky.cpp 15 May 2003 18:56:15 -0000 1.34
@@ -114,9 +114,6 @@
} else {
_skyMusic = new SkyGmMusic(_detector->createMidi(), _skyDisk);
}
- // TODO: Add option for users with real MT32 to use it. Driver is done.
- // _skyMusic = new SkyMT32Music(_detector->createMidi(), _skyDisk);
-
_gameVersion = _skyDisk->determineGameVersion();
_skyText = new SkyText(_skyDisk, _gameVersion, _language);
More information about the Scummvm-git-logs
mailing list