diff --git a/src/plugins/fluidsynthsoundcontroller/fluidsynthsoundcontroller.cpp b/src/plugins/fluidsynthsoundcontroller/fluidsynthsoundcontroller.cpp --- a/src/plugins/fluidsynthsoundcontroller/fluidsynthsoundcontroller.cpp +++ b/src/plugins/fluidsynthsoundcontroller/fluidsynthsoundcontroller.cpp @@ -72,17 +72,21 @@ void FluidSynthSoundController::setPitch(qint8 pitch) { - m_pitch = pitch; - fluid_synth_cc(m_synth, 1, 101, 0); - fluid_synth_cc(m_synth, 1, 6, 12); - float accurate_pitch = (m_pitch + 12) * (2.0 / 3) * 1024; - fluid_synth_pitch_bend(m_synth, 1, qMin(qRound(accurate_pitch), 16 * 1024 - 1)); + if (m_pitch != pitch) { + m_pitch = pitch; + fluid_synth_cc(m_synth, 1, 101, 0); + fluid_synth_cc(m_synth, 1, 6, 12); + float accurate_pitch = (m_pitch + 12) * (2.0 / 3) * 1024; + fluid_synth_pitch_bend(m_synth, 1, qMin(qRound(accurate_pitch), 16 * 1024 - 1)); + } } void FluidSynthSoundController::setVolume(quint8 volume) { - m_volume = volume; - fluid_synth_cc(m_synth, 1, 7, m_volume * 127 / 200); + if (m_volume != volume) { + m_volume = volume; + fluid_synth_cc(m_synth, 1, 7, m_volume * 127 / 200); + } } void FluidSynthSoundController::setTempo (quint8 tempo)