RCS file: /cvsroot/scummvm/scummvm/scumm/imuse.cpp,v
retrieving revision 1.54
diff -u -r1.54 imuse.cpp
|
|
|
283 | 283 | |
284 | 284 | void update_pris(); |
285 | 285 | |
286 | | void changed(byte what); |
| 286 | void changed(uint16 what); |
287 | 287 | }; |
288 | 288 | |
289 | 289 | /* Abstract IMuseInternal driver class */ |
… |
… |
|
298 | 298 | pcEffectLevel = 32, |
299 | 299 | pcProgram = 64, |
300 | 300 | pcChorus = 128, |
301 | | pcAll = 255, |
| 301 | pcPitchBendFactor = 256, |
| 302 | pcAll = 511, |
302 | 303 | }; |
303 | 304 | |
304 | 305 | virtual void on_timer() = 0; |
… |
… |
|
312 | 313 | virtual void part_key_on(Part *part, byte note, byte velocity) = 0; |
313 | 314 | virtual void part_key_off(Part *part, byte note) = 0; |
314 | 315 | virtual void part_off(Part *part) = 0; |
315 | | virtual void part_changed(Part *part, byte what) = 0; |
| 316 | virtual void part_changed(Part *part, uint16 what) = 0; |
316 | 317 | virtual void part_set_param(Part *part, byte param, int value) = 0; |
317 | 318 | virtual int part_update_active(Part *part, uint16 *active) = 0; |
318 | 319 | }; |
… |
… |
|
573 | 574 | void part_key_on(Part *part, byte note, byte velocity); |
574 | 575 | void part_key_off(Part *part, byte note); |
575 | 576 | void part_set_param(Part *part, byte param, int value); |
576 | | void part_changed(Part *part, byte what); |
| 577 | void part_changed(Part *part, uint16 what); |
577 | 578 | void part_off(Part *part); |
578 | 579 | int part_update_active(Part *part, uint16 *active); |
579 | 580 | void adjust_priorities() { |
… |
… |
|
602 | 603 | MidiChannelGM _midi_channels[9]; |
603 | 604 | |
604 | 605 | int16 _midi_pitchbend_last[16]; |
| 606 | byte _midi_pitchbend_factor_last[16]; |
605 | 607 | uint8 _midi_volume_last[16]; |
606 | 608 | bool _midi_pedal_last[16]; |
607 | 609 | byte _midi_modwheel_last[16]; |
… |
… |
|
611 | 613 | |
612 | 614 | |
613 | 615 | void midiPitchBend(byte chan, int16 pitchbend); |
| 616 | void midiPitchBendFactor (byte chan, byte factor); |
614 | 617 | void midiVolume(byte chan, byte volume); |
615 | 618 | void midiPedal(byte chan, bool pedal); |
616 | 619 | void midiModWheel(byte chan, byte modwheel); |
… |
… |
|
638 | 641 | void part_set_param(Part *part, byte param, int value) {} |
639 | 642 | void part_key_on(Part *part, byte note, byte velocity); |
640 | 643 | void part_key_off(Part *part, byte note); |
641 | | void part_changed(Part *part, byte what); |
| 644 | void part_changed(Part *part, uint16 what); |
642 | 645 | |
643 | 646 | static int midi_driver_thread(void *param); |
644 | 647 | |
… |
… |
|
2066 | 2074 | case 0xE: /* pitch bend */ |
2067 | 2075 | part = get_part(chan); |
2068 | 2076 | if (part) |
2069 | | part->set_pitchbend(((s[1] - 0x40) << 7) | s[0]); |
| 2077 | // part->set_pitchbend(((s[1] - 0x40) << 7) | s[0]); |
| 2078 | part->set_pitchbend(((s[1] << 7) | s[0]) - 0x2000); |
2070 | 2079 | s += 2; |
2071 | 2080 | break; |
2072 | 2081 | |
… |
… |
|
3200 | 3217 | return; |
3201 | 3218 | set_pitchbend(0); |
3202 | 3219 | _pitchbend_factor = value; |
| 3220 | changed (IMuseDriver::pcPitchBendFactor); |
3203 | 3221 | } |
3204 | 3222 | |
3205 | 3223 | void Part::set_onoff(bool on) |
… |
… |
|
3293 | 3311 | _drv->part_off(this); |
3294 | 3312 | } |
3295 | 3313 | |
3296 | | void Part::changed(byte what) |
| 3314 | void Part::changed(uint16 what) |
3297 | 3315 | { |
3298 | 3316 | _drv->part_changed(this, what); |
3299 | 3317 | } |
… |
… |
|
4142 | 4160 | }; |
4143 | 4161 | |
4144 | 4162 | |
4145 | | void IMuseAdlib::part_changed(Part *part, byte what) |
| 4163 | void IMuseAdlib::part_changed(Part *part, uint16 what) |
4146 | 4164 | { |
4147 | 4165 | MidiChannelAdl *mc; |
4148 | 4166 | |
… |
… |
|
4449 | 4467 | } |
4450 | 4468 | } |
4451 | 4469 | |
| 4470 | void IMuseGM::midiPitchBendFactor (byte chan, byte factor) { |
| 4471 | if (_midi_pitchbend_factor_last[chan] != factor) { |
| 4472 | _midi_pitchbend_factor_last[chan] = factor; |
| 4473 | _md->send(( 0 << 16) | (101 << 8) | (0xB0 | chan)); |
| 4474 | _md->send(( 0 << 16) | (100 << 8) | (0xB0 | chan)); |
| 4475 | _md->send((factor << 16) | ( 6 << 8) | (0xB0 | chan)); |
| 4476 | _md->send(( 0 << 16) | ( 38 << 8) | (0xB0 | chan)); |
| 4477 | } |
| 4478 | } |
| 4479 | |
4452 | 4480 | void IMuseGM::midiVolume(byte chan, byte volume) |
4453 | 4481 | { |
4454 | 4482 | if (_midi_volume_last[chan] != volume) { |
… |
… |
|
4714 | 4742 | return count; |
4715 | 4743 | } |
4716 | 4744 | |
4717 | | void IMuseGM::part_changed(Part *part, byte what) |
| 4745 | void IMuseGM::part_changed(Part *part, uint16 what) |
4718 | 4746 | { |
4719 | 4747 | MidiChannelGM *mc; |
4720 | 4748 | |
… |
… |
|
4733 | 4761 | memset(mc->_actives, 0, sizeof(mc->_actives)); |
4734 | 4762 | return; |
4735 | 4763 | } |
| 4764 | |
| 4765 | if (what & pcPitchBendFactor) |
| 4766 | midiPitchBendFactor (mc->_chan, part->_pitchbend_factor); |
4736 | 4767 | |
4737 | 4768 | if (what & pcMod) |
4738 | 4769 | midiPitchBend(mc->_chan, |