summaryrefslogtreecommitdiff
path: root/src/inputprocessor.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2024-08-04 09:21:22 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2024-08-04 09:21:22 +0200
commite84e9938345bb124eb2d47a73fb324e95ac652be (patch)
treec319a12e7e1729e6d6821b415d3f812c7dd81224 /src/inputprocessor.cc
parentaf48a660a3410c3a63cab324fd8a345b648f821d (diff)
Diffstat (limited to 'src/inputprocessor.cc')
-rw-r--r--src/inputprocessor.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/inputprocessor.cc b/src/inputprocessor.cc
index 67a0ec2..29c4ac5 100644
--- a/src/inputprocessor.cc
+++ b/src/inputprocessor.cc
@@ -37,7 +37,7 @@
#include "staminafilter.h"
#include "velocityfilter.h"
#include "positionfilter.h"
-
+#include <iostream>
#include "cpp11fix.h"
class VelocityStorer
@@ -252,7 +252,12 @@ bool InputProcessor::processOnset(event_t& event, std::size_t pos,
const auto power_range = instr->getPowers(event.position);
const auto power_span = power_range.max - power_range.min;
const auto note_power = power_range.min + event.velocity * power_span;
- const auto sample = instr->sample(note_power, power_span, event.position, event.offset + pos);
+
+ const auto position_range = instr->getPositionRange();
+ const auto position_span = position_range.max - position_range.min;
+ const auto note_position = position_range.min + event.position * position_span;
+
+ const auto sample = instr->sample(note_power, power_span, note_position, position_span, event.offset + pos);
if(sample == nullptr)
{