diff options
Diffstat (limited to 'src/inputprocessor.cc')
-rw-r--r-- | src/inputprocessor.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/inputprocessor.cc b/src/inputprocessor.cc index 96bc2c0..5e58661 100644 --- a/src/inputprocessor.cc +++ b/src/inputprocessor.cc @@ -28,7 +28,7 @@ #include <list> -#include "hugin.hpp" +#include <hugin.hpp> #include "instrument.h" @@ -133,6 +133,7 @@ bool InputProcessor::processOnset(event_t& event, } } + auto orig_level = event.velocity; for(auto& filter : filters) { // This line might change the 'event' variable @@ -152,6 +153,11 @@ bool InputProcessor::processOnset(event_t& event, return false; } + auto selected_level = + (sample->getPower() - instr->getMinPower()) / + (instr->getMaxPower() - instr->getMinPower()); + settings.velocity_modifier_current.store(selected_level / orig_level); + for(Channel& ch: kit.channels) { AudioFile* af = sample->getAudioFile(ch); |