diff options
author | Hans Petter Selasky <hps@selasky.org> | 2017-05-12 10:28:23 +0200 |
---|---|---|
committer | Goran Mekić <meka@tilda.center> | 2017-05-12 11:04:14 +0200 |
commit | 8c3af076c93b430102db817b68cc7e43d764db0c (patch) | |
tree | c0094e8c96d66bd5cd97686e16ed21cde04f6bb2 /drumgizmo/input/midifile.cc | |
parent | 409f3a4ff1a4661a296a5bada5e9e2ea5e4ba142 (diff) |
Use correct MIDI note ON mask.
Signed-off-by: Hans Petter Selasky <hps@selasky.org>
Diffstat (limited to 'drumgizmo/input/midifile.cc')
-rw-r--r-- | drumgizmo/input/midifile.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drumgizmo/input/midifile.cc b/drumgizmo/input/midifile.cc index 89ffa6b..c3bd8ae 100644 --- a/drumgizmo/input/midifile.cc +++ b/drumgizmo/input/midifile.cc @@ -30,6 +30,7 @@ #include "midifile.h" static int const NOTE_ON = 0x90; +static int const NOTE_MASK = 0xF0; MidifileInputEngine::MidifileInputEngine() : AudioInputEngineMidi{} @@ -147,7 +148,7 @@ void MidifileInputEngine::run(size_t pos, size_t len, std::vector<event_t>& even if(!smf_event_is_metadata(current_event)) { if((current_event->midi_buffer_length == 3) && - ((current_event->midi_buffer[0] & NOTE_ON) == NOTE_ON) && + ((current_event->midi_buffer[0] & NOTE_MASK) == NOTE_ON) && (track == -1 || current_event->track_number == track) && current_event->midi_buffer[2] > 0) { |