From 1669daa78868559ef689cd807c64819c24b1f441 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Tue, 31 Aug 2010 15:22:55 +0200 Subject: [PATCH] ZynAddSubFX: forward all MIDI events but NoteOn if muted There's no reason for not forwarding MIDI events such as NoteOff, ControlChange etc. when muted. Therefore only do not forward NoteOn when muted. (cherry picked from commit 39918f8835c877dd753939552ae177a7984da920) --- plugins/zynaddsubfx/ZynAddSubFx.cpp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/plugins/zynaddsubfx/ZynAddSubFx.cpp b/plugins/zynaddsubfx/ZynAddSubFx.cpp index 4d6db2de7..54ee11062 100644 --- a/plugins/zynaddsubfx/ZynAddSubFx.cpp +++ b/plugins/zynaddsubfx/ZynAddSubFx.cpp @@ -293,20 +293,23 @@ void ZynAddSubFxInstrument::play( sampleFrame * _buf ) bool ZynAddSubFxInstrument::handleMidiEvent( const midiEvent & _me, const midiTime & _time ) { - if( !isMuted() ) + // do not send NoteOn events if muted + if( _me.type() == MidiNoteOn && isMuted() ) { - m_pluginMutex.lock(); - if( m_remotePlugin ) - { - m_remotePlugin->processMidiEvent( _me, 0 ); - } - else - { - m_plugin->processMidiEvent( _me ); - } - m_pluginMutex.unlock(); + return true; } + m_pluginMutex.lock(); + if( m_remotePlugin ) + { + m_remotePlugin->processMidiEvent( _me, 0 ); + } + else + { + m_plugin->processMidiEvent( _me ); + } + m_pluginMutex.unlock(); + return true; }