diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2019-04-01 20:22:14 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2019-04-08 18:08:42 +0200 |
commit | 10d483417fa70bb4c357d598f3bdfcf4f0b75f21 (patch) | |
tree | 08f3055d0432511e8e9fbd362bd05307d95c9f5c /plugin | |
parent | aa6ef7e42966e36db74a4d15367379cbff37bbc8 (diff) |
Add midi aftertouch choke for plugins.
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 |