Ticket #8277: mt32pitchbend.diff

File mt32pitchbend.diff, 2.0 KB (added by SF/jamieson630, 17 years ago)

MT-32 pitchbend range patch, rev 1

  • scummvm/scumm/imuse.cpp

    RCS file: /cvsroot/scummvm/scummvm/scumm/imuse.cpp,v
    retrieving revision 2.97
    diff -u -r2.97 imuse.cpp
     
    4343
    4444IMuseInternal::IMuseInternal() :
    4545_old_adlib_instruments(false),
     46_native_mt32(false),
    4647_enable_multi_midi(false),
    4748_midi_adlib(0),
    4849_midi_native(0),
     
    10851086                break;
    10861087
    10871088        case IMuse::PROP_NATIVE_MT32:
     1089                _native_mt32 = (value > 0);
    10881090                Instrument::nativeMT32(value > 0);
    10891091                break;
    10901092
     
    15001502                return;
    15011503        set_pitchbend(0);
    15021504        _pitchbend_factor = value;
    1503         if (_mc)
    1504                 _mc->pitchBendFactor(_pitchbend_factor);
     1505        if (_mc) {
     1506                if (!_player->_se->isNativeMT32()) {
     1507                        _mc->pitchBendFactor(_pitchbend_factor);
     1508                } else if (_mc->getNumber() < 8) {
     1509                        byte buffer[] = { 0x41, 0x00, 0x16, 0x12, 0x03, 0x00, 0x04, 0x00, 0x00 };
     1510                        buffer[1] = _mc->getNumber();
     1511                        buffer[7] = value;
     1512                        buffer[8] = (0 - buffer[4] - buffer[5] - buffer[6] - buffer[7]) & 0x3F;
     1513                        _mc->device()->sysEx(buffer, 9);
     1514                }
     1515        }
    15051516}
    15061517
    15071518void Part::set_onoff(bool on) {
  • scummvm/scumm/imuse_internal.h

    RCS file: /cvsroot/scummvm/scummvm/scumm/imuse_internal.h,v
    retrieving revision 2.23
    diff -u -r2.23 imuse_internal.h
     
    350350
    351351protected:
    352352        bool _old_adlib_instruments;
     353        bool _native_mt32;
    353354        bool _enable_multi_midi;
    354355        MidiDriver *_midi_adlib;
    355356        MidiDriver *_midi_native;
     
    445446        void reallocateMidiChannels(MidiDriver *midi);
    446447        void setGlobalAdlibInstrument(byte slot, byte *data);
    447448        void copyGlobalAdlibInstrument(byte slot, Instrument *dest);
     449        bool isNativeMT32() { return _native_mt32; }
    448450
    449451        // IMuse interface
    450452