diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2019-04-08 17:42:00 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2019-04-08 18:08:43 +0200 |
commit | 723343269d161b2bba7aee4597357ffc32f26f04 (patch) | |
tree | 65b25278bcf029ce5f34420a0caaee634b0c9c04 /drumgizmo/input/jackmidi.cc | |
parent | 10d483417fa70bb4c357d598f3bdfcf4f0b75f21 (diff) |
Move midi note process to one common place in AudioInputEngineMidi::processNote and use it in the four input engines (plugin, midifile, ossmidi and jackmidi)
Diffstat (limited to 'drumgizmo/input/jackmidi.cc')
-rw-r--r-- | drumgizmo/input/jackmidi.cc | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/drumgizmo/input/jackmidi.cc b/drumgizmo/input/jackmidi.cc index 8459e67..cf4dc6c 100644 --- a/drumgizmo/input/jackmidi.cc +++ b/drumgizmo/input/jackmidi.cc @@ -30,9 +30,6 @@ #include "cpp11fix.h" // required for c++11 #include "jackmidi.h" -static int const NOTE_ON = 0x90; -static int const NOTE_MASK = 0xF0; - JackMidiInputEngine::JackMidiInputEngine(JackClient& client) : AudioInputEngineMidi{} , JackProcess{} @@ -119,22 +116,7 @@ void JackMidiInputEngine::process(jack_nframes_t num_frames) { jack_midi_event_t event; jack_midi_event_get(&event, buffer, i); - if(event.size != 3) - { - continue; - } - if((event.buffer[0] & NOTE_MASK) != NOTE_ON) - { - continue; - } - int key = event.buffer[1]; - int velocity = event.buffer[2]; - printf("Event key:%d vel:%d\n", key, velocity); - int k = mmap.lookup(key); - if(k != -1 && velocity) - { - events.push_back({EventType::OnSet, (size_t)k, event.time, velocity / 127.f}); - } + processNote(event.buffer, event.size, event.time, events); } jack_midi_clear_buffer(buffer); pos += num_frames; |