diff options
author | James Brown | 2002-05-08 05:32:59 +0000 |
---|---|---|
committer | James Brown | 2002-05-08 05:32:59 +0000 |
commit | a3edfd87ad0d3c7eed7384b96f87871db2cc4578 (patch) | |
tree | 057edbee1b0fc6b6bb7c1f7e0d21fbb138db22de /sound/mididrv.cpp | |
parent | b2afb797cde4e4d1717b6ade3ca86eec2ae80cf6 (diff) | |
download | scummvm-rg350-a3edfd87ad0d3c7eed7384b96f87871db2cc4578.tar.gz scummvm-rg350-a3edfd87ad0d3c7eed7384b96f87871db2cc4578.tar.bz2 scummvm-rg350-a3edfd87ad0d3c7eed7384b96f87871db2cc4578.zip |
Add possible code for Modulation/Sustain to Emulated Midi Driver
svn-id: r4236
Diffstat (limited to 'sound/mididrv.cpp')
-rw-r--r-- | sound/mididrv.cpp | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/sound/mididrv.cpp b/sound/mididrv.cpp index 2338eb66e4..12c2011169 100644 --- a/sound/mididrv.cpp +++ b/sound/mididrv.cpp @@ -1153,13 +1153,43 @@ void MidiDriver_MIDIEMU::send(uint32 b) 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); break; |