summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/inputprocessor.cc4
-rw-r--r--src/inputprocessor.h2
2 files changed, 5 insertions, 1 deletions
diff --git a/src/inputprocessor.cc b/src/inputprocessor.cc
index 1dbd79e..96bc2c0 100644
--- a/src/inputprocessor.cc
+++ b/src/inputprocessor.cc
@@ -44,6 +44,7 @@ InputProcessor::InputProcessor(Settings& settings,
: kit(kit)
, activeevents(activeevents)
, is_stopping(false)
+ , settings(settings)
{
// Build filter list
filters.emplace_back(std::make_unique<StaminaFilter>(settings));
@@ -121,7 +122,8 @@ bool InputProcessor::processOnset(event_t& event,
if(event_sample.group == instr->getGroup() &&
event_sample.instrument != instr)
{
- event_sample.rampdown = 3000; // Ramp down 3000 samples
+ // Ramp down 14.7ms (3000 samples in 44k1Hz)
+ event_sample.rampdown = settings.samplerate.load() / 14.7;
// TODO: This must be configurable at some point...
// ... perhaps even by instrument (ie. in the xml file)
event_sample.ramp_start = event_sample.rampdown;
diff --git a/src/inputprocessor.h b/src/inputprocessor.h
index cf62ea2..95fdfdb 100644
--- a/src/inputprocessor.h
+++ b/src/inputprocessor.h
@@ -62,4 +62,6 @@ private:
bool processStop(event_t& event);
std::vector<std::unique_ptr<InputFilter>> filters;
+
+ Settings& settings;
};