Ticket #1245: mt32-bend-range.diff

File mt32-bend-range.diff, 1.9 KB (added by SF/logicdeluxe, 21 years ago)

fixes MT-32 pitch bends

  • scumm\imuse_internal.h

    old new  
    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
  • scumm\imuse.cpp

    old new  
    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),
     
    10781079                break;
    10791080
    10801081        case IMuse::PROP_NATIVE_MT32:
     1082                _native_mt32 = (value > 0);
    10811083                Instrument::nativeMT32(value > 0);
    10821084                break;
    10831085
     
    14191421}
    14201422
    14211423void Part::set_pitchbend(int value) {
    1422         _pitchbend = value;
     1424        if (!_player->_se->isNativeMT32())
     1425                _pitchbend = value;
     1426        else
     1427                _pitchbend = value * _pitchbend_factor / 12;
    14231428        if (_mc) {
    14241429                _mc->pitchBend(clamp(_pitchbend +
    14251430                                                (_detune_eff * 64 / 12) +
     
    14931498                return;
    14941499        set_pitchbend(0);
    14951500        _pitchbend_factor = value;
    1496         if (_mc)
    1497                 _mc->pitchBendFactor(_pitchbend_factor);
     1501        if (_mc) {
     1502                if (!_player->_se->isNativeMT32())
     1503                        _mc->pitchBendFactor(_pitchbend_factor);
     1504        }
    14981505}
    14991506
    15001507void Part::set_onoff(bool on) {
     
    16151622
    16161623void Part::sendAll() {
    16171624        if (!clearToTransmit()) return;
    1618         _mc->pitchBendFactor(_pitchbend_factor);
     1625        if (!_player->_se->isNativeMT32())
     1626                _mc->pitchBendFactor(_pitchbend_factor);
    16191627        _mc->pitchBend(clamp(_pitchbend +
    16201628                       (_detune_eff * 64 / 12) +
    16211629                       (_transpose_eff * 8192 / 12), -8192, 8191));