diff options
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/drumgizmo_plugin.cc | 32 | ||||
m--------- | plugin/plugingizmo | 0 |
2 files changed, 25 insertions, 7 deletions
diff --git a/plugin/drumgizmo_plugin.cc b/plugin/drumgizmo_plugin.cc index 3328f6b..67436af 100644 --- a/plugin/drumgizmo_plugin.cc +++ b/plugin/drumgizmo_plugin.cc @@ -372,15 +372,33 @@ void DrumGizmoPlugin::Input::run(size_t pos, size_t len, std::vector<event_t>& e for(auto& event : *plugin.input_events) { - if(event.type != MidiEventType::NoteOn) + switch(event.type) { - continue; - } + case MidiEventType::NoteOn: + { + int i = mmap.lookup(event.key); + if(event.velocity != 0 && (i != -1)) + { + events.push_back({EventType::OnSet, (size_t)i, + (size_t)event.getTime(), event.velocity / 127.0f}); + } + } + break; - int i = mmap.lookup(event.key); - if(event.velocity && (i != -1)) - { - events.push_back({EventType::OnSet, (size_t)i, (size_t)event.getTime(), event.velocity / 127.0f}); + case MidiEventType::Aftertouch: + { + int i = mmap.lookup(event.key); + if(event.velocity == 0 && i != -1) + { + events.push_back({EventType::Choke, (size_t)i, + (size_t)event.getTime(), .0f}); + } + } + break; + + case MidiEventType::NoteOff: + case MidiEventType::Unknown: + break; } } } diff --git a/plugin/plugingizmo b/plugin/plugingizmo -Subproject cf2311b09f788447d1c079274405477992eee9e +Subproject 34bfc5046bd297311a38dace8914c51905ca9d2 |