summaryrefslogtreecommitdiff
path: root/src/inputprocessor.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2018-07-15 20:35:52 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2018-07-15 20:41:10 +0200
commita0484778a9953dfd1948bf4dac71c51deab18cab (patch)
tree15b9ff0c0b745b0efb02375d285ade09bbdf0f18 /src/inputprocessor.cc
parent34578fdef6a9f77aa285501130be55fcd560c03d (diff)
Revorked visualiser UI and a few more parameter tweaks.
Diffstat (limited to 'src/inputprocessor.cc')
-rw-r--r--src/inputprocessor.cc8
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);