summaryrefslogtreecommitdiff
path: root/src/inputprocessor.cc
diff options
context:
space:
mode:
authorAndré Nusser <andre.nusser@googlemail.com>2019-07-26 00:25:30 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2019-10-14 22:04:13 +0200
commit1f7d744819968aec3c82035f730558cb73e0bd18 (patch)
treea899777609cfc7740638ab66998ca06fa2cfca6b /src/inputprocessor.cc
parentc4397e38f1ba24993445867791ccd61b4bd1b0f8 (diff)
Add support for normalized samples in the engine.
This is untested and also the part of the parser is missing.
Diffstat (limited to 'src/inputprocessor.cc')
-rw-r--r--src/inputprocessor.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/inputprocessor.cc b/src/inputprocessor.cc
index 819a3c7..eb45f4b 100644
--- a/src/inputprocessor.cc
+++ b/src/inputprocessor.cc
@@ -207,9 +207,14 @@ bool InputProcessor::processOnset(event_t& event,
else
{
//DEBUG(inputprocessor, "Adding event %d.\n", event.offset);
- Event* evt = new EventSample(ch.num, 1.0, af, instr->getGroup(),
+ auto evt = new EventSample(ch.num, 1.0, af, instr->getGroup(),
instrument_id);
evt->offset = (event.offset + pos) * resample_ratio;
+ if(settings.normalized_samples.load())
+ {
+ evt->scale *= event.velocity;
+ }
+
activeevents[ch.num].push_back(evt);
}
}