RCS file: /cvsroot/scummvm/scummvm/scumm/imuse.cpp,v
retrieving revision 1.12
diff -u -r1.12 imuse.cpp
|
|
|
3110 | 3110 | |
3111 | 3111 | void Part::set_pitchbend(int value) |
3112 | 3112 | { |
3113 | | _pitchbend = value * _pitchbend_factor >> 6; |
| 3113 | _pitchbend = value; |
3114 | 3114 | changed(IMuseDriver::pcMod); |
3115 | 3115 | } |
3116 | 3116 | |
… |
… |
|
3993 | 3993 | if (what & pcMod) { |
3994 | 3994 | for (mc = part->_mc->adl(); mc; mc = mc->_next) { |
3995 | 3995 | adlib_note_on(mc->_channel, mc->_note + part->_transpose_eff, |
3996 | | part->_pitchbend + part->_detune_eff); |
| 3996 | (part->_pitchbend * part->_pitchbend_factor >> 6) + part->_detune_eff); |
3997 | 3997 | } |
3998 | 3998 | } |
3999 | 3999 | |
… |
… |
|
4278 | 4278 | |
4279 | 4279 | if (_midi_pitchbend_last[chan] != pitchbend) { |
4280 | 4280 | _midi_pitchbend_last[chan] = pitchbend; |
4281 | | tmp = (pitchbend << 2) + 0x2000; |
| 4281 | tmp = pitchbend + 0x2000; |
4282 | 4282 | _md->send(((tmp >> 7) & 0x7F) << 16 | (tmp & 0x7F) << 8 | 0xE0 | chan); |
4283 | 4283 | } |
4284 | 4284 | } |
… |
… |
|
4570 | 4570 | |
4571 | 4571 | if (what & pcMod) |
4572 | 4572 | midiPitchBend(mc->_chan, |
4573 | | clamp(part->_pitchbend + part->_detune_eff + |
4574 | | (part->_transpose_eff << 7), -2048, 2047)); |
| 4573 | clamp(part->_pitchbend + |
| 4574 | (part->_detune_eff * 64 / 12) + |
| 4575 | (part->_transpose_eff * 8192 / 12), -8192, 8191)); |
4575 | 4576 | |
4576 | 4577 | if (what & pcVolume) |
4577 | 4578 | midiVolume(mc->_chan, part->_vol_eff); |
RCS file: /cvsroot/scummvm/scummvm/sound/mididrv.cpp,v
retrieving revision 1.5
diff -u -r1.5 mididrv.cpp
|
|
|
87 | 87 | } |
88 | 88 | |
89 | 89 | void CALLBACK MidiDriver_WIN::midi_callback(HMIDIOUT hmo, UINT wMsg, |
90 | | DWORD dwInstance, DWORD dwParam1, DWORD dwParam2) |
| 90 | DWORD dwInstance, DWORD dwParam1, DWORD dwParam2) |
91 | 91 | { |
92 | 92 | |
93 | 93 | switch (wMsg) { |
… |
… |
|
111 | 111 | MMRESULT res = midiOutOpen((HMIDIOUT *) & _mo, MIDI_MAPPER, NULL, NULL, 0); |
112 | 112 | if (res != MMSYSERR_NOERROR) |
113 | 113 | check_error(res); |
| 114 | |
| 115 | // Send initial pitch bend sensitivity values for +/- 12 semitones. |
| 116 | // For information on control change registered parameters, |
| 117 | // which includes the Pitch Bend sensitivity settings, |
| 118 | // visit http://www.midi.org/about-midi/table3.htm, |
| 119 | // Table 3a. |
| 120 | int chan; |
| 121 | for (chan = 0; chan < 16; ++chan) { |
| 122 | send(( 0 << 16) | (101 << 8) | (0xB0 | chan)); |
| 123 | send(( 0 << 16) | (100 << 8) | (0xB0 | chan)); |
| 124 | send((12 << 16) | ( 6 << 8) | (0xB0 | chan)); |
| 125 | send(( 0 << 16) | ( 38 << 8) | (0xB0 | chan)); |
| 126 | } // next for |
114 | 127 | } else { |
115 | 128 | /* streaming mode */ |
116 | 129 | MIDIPROPTIMEDIV mptd; |
117 | 130 | UINT _midi_device_id = 0; |
118 | 131 | |
119 | 132 | check_error(midiStreamOpen(&_ms, &_midi_device_id, 1, |
120 | | (uint32)midi_callback, (uint32)this, CALLBACK_FUNCTION)); |
| 133 | (uint32)midi_callback, (uint32)this, CALLBACK_FUNCTION)); |
121 | 134 | |
122 | 135 | prepare(); |
123 | 136 | |