diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2018-07-15 18:55:26 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2018-07-15 18:55:26 +0200 |
commit | 3e003e674b31ca1308f5c32125f5a2152e773f17 (patch) | |
tree | bf02f68fae42624e41065e8f99102317b7b26ac0 /src/inputprocessor.cc | |
parent | f1727b39be71f1c6acd050defaee8d61c1140be7 (diff) |
Make sample ramp-down samplerate dependent: 14.7ms.
Diffstat (limited to 'src/inputprocessor.cc')
-rw-r--r-- | src/inputprocessor.cc | 4 |
1 files changed, 3 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; |