diff --git a/fluidpatcher/__init__.py b/fluidpatcher/__init__.py index 99fbd1e..c27aa2c 100644 --- a/fluidpatcher/__init__.py +++ b/fluidpatcher/__init__.py @@ -461,6 +461,8 @@ def _midisignal_handler(self, sig): sig.patch = -1 sig.val = 0 if self.midi_callback: self.midi_callback(sig) + if 'patch' in sig: + return True def _refresh_bankfonts(self): sfneeded = set() diff --git a/fluidpatcher/pfluidsynth.py b/fluidpatcher/pfluidsynth.py index 277a80d..b05831c 100644 --- a/fluidpatcher/pfluidsynth.py +++ b/fluidpatcher/pfluidsynth.py @@ -626,9 +626,9 @@ def custom_midi_router(self, event): elif LADSPA_SUPPORT and 'ladspafx' in rule: if res.ladspafx in self.ladspafx: self.ladspafx[res.ladspafx].setcontrol(res.port, res.val) - else: - # not handled here, pass it to the callback - if self.midi_callback: self.midi_callback(res) + elif self.midi_callback: + # not handled here, pass result to the callback + if self.midi_callback(res): return if dt > 0: self.clocks = t, self.clocks[0] if self.midi_callback: # send the original event to the callback