From eda317924ec0573d5c2a8407feaa8dafb6d4a9bc Mon Sep 17 00:00:00 2001 From: Jerome Fisher Date: Sun, 3 Apr 2005 22:01:38 +0000 Subject: Committed patch #1168149 (Shared GM/MT-32 mapping) by eriktorbjorn as-is. This does the following: - Replaces multiple identical MT-32-to-General MIDI mapping tables with a common one in MidiDriver. - Changes Sky's GmChannel class to allow NULL instrument and velocity mapping tables, giving a 1-to-1 mapping without creating a dummy table. svn-id: r17361 --- sound/mididrv.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'sound/mididrv.cpp') diff --git a/sound/mididrv.cpp b/sound/mididrv.cpp index 7bca3eff03..5567d7134c 100644 --- a/sound/mididrv.cpp +++ b/sound/mididrv.cpp @@ -69,6 +69,29 @@ static const struct MidiDriverDescription midiDrivers[] = { {0, 0, 0} }; +const byte MidiDriver::_mt32ToGm[128] = { +// 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 + 6, 6, 6, 7, 7, 7, 8, 112, 62, 62, 63, 63, 38, 38, 39, 39, // 1x + 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, 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 +}; + +const byte MidiDriver::_gmToMt32[128] = { +// 0 1 2 3 4 5 6 7 8 9 A B C D E F + 5, 1, 2, 7, 3, 5, 16, 21, 22, 101, 101, 97, 104, 103, 102, 20, // 0x + 8, 9, 11, 12, 14, 15, 87, 15, 59, 60, 61, 62, 67, 44, 79, 23, // 1x + 64, 67, 66, 70, 68, 69, 28, 31, 52, 54, 55, 56, 49, 51, 57, 112, // 2x + 48, 50, 45, 26, 34, 35, 45, 122, 89, 90, 94, 81, 92, 95, 24, 25, // 3x + 80, 78, 79, 78, 84, 85, 86, 82, 74, 72, 76, 77, 110, 107, 108, 76, // 4x + 47, 44, 111, 45, 44, 34, 44, 30, 32, 33, 88, 34, 35, 35, 38, 33, // 5x + 41, 36, 100, 37, 40, 34, 43, 40, 63, 21, 99, 105, 103, 86, 55, 84, // 6x + 101, 103, 100, 120, 117, 113, 99, 128, 128, 128, 128, 124, 123, 128, 128, 128, // 7x +}; const MidiDriverDescription *MidiDriver::getAvailableMidiDrivers() { return midiDrivers; -- cgit v1.2.3