diff --git a/plugins/zynaddsubfx/LocalZynAddSubFx.cpp b/plugins/zynaddsubfx/LocalZynAddSubFx.cpp index b6c77bb69..05b6a725e 100644 --- a/plugins/zynaddsubfx/LocalZynAddSubFx.cpp +++ b/plugins/zynaddsubfx/LocalZynAddSubFx.cpp @@ -190,6 +190,16 @@ void LocalZynAddSubFx::setLmmsWorkingDir( const std::string & _dir ) +void LocalZynAddSubFx::setPitchWheelBendRange( int semitones ) +{ + for( int i = 0; i < NUM_MIDI_PARTS; ++i ) + { + m_master->part[i]->ctl.setpitchwheelbendrange( semitones * 100 ); + } +} + + + void LocalZynAddSubFx::processMidiEvent( const MidiEvent& event ) { // all functions are called while m_master->mutex is held diff --git a/plugins/zynaddsubfx/LocalZynAddSubFx.h b/plugins/zynaddsubfx/LocalZynAddSubFx.h index 01bd2241e..baec21396 100644 --- a/plugins/zynaddsubfx/LocalZynAddSubFx.h +++ b/plugins/zynaddsubfx/LocalZynAddSubFx.h @@ -49,6 +49,8 @@ public: void setPresetDir( const std::string & _dir ); void setLmmsWorkingDir( const std::string & _dir ); + void setPitchWheelBendRange( int semitones ); + void processMidiEvent( const MidiEvent& event ); void processAudio( sampleFrame * _out ); diff --git a/plugins/zynaddsubfx/RemoteZynAddSubFx.cpp b/plugins/zynaddsubfx/RemoteZynAddSubFx.cpp index 5e25de9fa..e769594fa 100644 --- a/plugins/zynaddsubfx/RemoteZynAddSubFx.cpp +++ b/plugins/zynaddsubfx/RemoteZynAddSubFx.cpp @@ -119,6 +119,10 @@ public: LocalZynAddSubFx::setLmmsWorkingDir( _m.getString() ); break; + case IdZasfSetPitchWheelBendRange: + LocalZynAddSubFx::setPitchWheelBendRange( _m.getInt() ); + break; + default: return RemotePluginClient::processMessage( _m ); } diff --git a/plugins/zynaddsubfx/RemoteZynAddSubFx.h b/plugins/zynaddsubfx/RemoteZynAddSubFx.h index 3abd0c494..23e9647b8 100644 --- a/plugins/zynaddsubfx/RemoteZynAddSubFx.h +++ b/plugins/zynaddsubfx/RemoteZynAddSubFx.h @@ -1,7 +1,7 @@ /* * RemoteZynAddSubFx.h - ZynAddSubFX-embedding plugin * - * Copyright (c) 2008-2010 Tobias Doerffel + * Copyright (c) 2008-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -30,7 +30,8 @@ enum ZasfRemoteMessageIDs { IdZasfPresetDirectory = IdUserBase, - IdZasfLmmsWorkingDirectory + IdZasfLmmsWorkingDirectory, + IdZasfSetPitchWheelBendRange } ; #endif diff --git a/plugins/zynaddsubfx/ZynAddSubFx.cpp b/plugins/zynaddsubfx/ZynAddSubFx.cpp index 57f65b82a..6af6aff16 100644 --- a/plugins/zynaddsubfx/ZynAddSubFx.cpp +++ b/plugins/zynaddsubfx/ZynAddSubFx.cpp @@ -133,6 +133,9 @@ ZynAddSubFxInstrument::ZynAddSubFxInstrument( connect( engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( reloadPlugin() ) ); + + connect( instrumentTrack()->pitchRangeModel(), SIGNAL( dataChanged() ), + this, SLOT( updatePitchRange() ) ); } @@ -378,6 +381,21 @@ void ZynAddSubFxInstrument::reloadPlugin() +void ZynAddSubFxInstrument::updatePitchRange() +{ + m_pluginMutex.lock(); + if( m_remotePlugin ) + { + m_remotePlugin->sendMessage( RemotePlugin::message( IdZasfSetPitchWheelBendRange ). + addInt( instrumentTrack()->midiPitchRange() ) ); + } + else + { + m_plugin->setPitchWheelBendRange( instrumentTrack()->midiPitchRange() ); + } + m_pluginMutex.unlock(); +} + #define GEN_CC_SLOT(slotname,midictl,modelname) \ void ZynAddSubFxInstrument::slotname() \ diff --git a/plugins/zynaddsubfx/ZynAddSubFx.h b/plugins/zynaddsubfx/ZynAddSubFx.h index 27154cff1..46230d5bf 100644 --- a/plugins/zynaddsubfx/ZynAddSubFx.h +++ b/plugins/zynaddsubfx/ZynAddSubFx.h @@ -91,6 +91,8 @@ public: private slots: void reloadPlugin(); + void updatePitchRange(); + void updatePortamento(); void updateFilterFreq(); void updateFilterQ();