Skip to content

Commit

Permalink
Fix issue #13 on GitHub.
Browse files Browse the repository at this point in the history
  • Loading branch information
Francois Best committed Apr 18, 2014
1 parent d13353a commit 6164e2c
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions src/MIDI.hpp
Expand Up @@ -483,24 +483,22 @@ inline bool MidiInterface<SerialPort>::read(Channel inChannel)
if (inChannel >= MIDI_CHANNEL_OFF)
return false; // MIDI Input disabled.

if (parse())
{
handleNullVelocityNoteOnAsNoteOff();
if (inputFilter(inChannel))
{
if (!parse())
return false;

#if (MIDI_BUILD_OUTPUT && MIDI_BUILD_THRU)
thruFilter(inChannel);
#endif
handleNullVelocityNoteOnAsNoteOff();
const bool channelMatch = inputFilter(inChannel);

#if MIDI_USE_CALLBACKS
launchCallback();
#endif
return true;
}
if (MIDI_USE_CALLBACKS && channelMatch)
{
launchCallback();
}

return false;
#if MIDI_BUILD_THRU
thruFilter(inChannel);
#endif

return channelMatch;
}

// -----------------------------------------------------------------------------
Expand Down

0 comments on commit 6164e2c

Please sign in to comment.