From e39d82f5a06db9d4c4c505d30c4ac116037e1399 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Thu, 2 Aug 2018 11:00:23 +0200 Subject: Just fix the fix comment and adapt code to make it more readable. Actually, this changes the ramp down to 2298 samples instead of 3000 for 44100 but I guess that's not audible and 68 is a nicer number. :) --- src/inputprocessor.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/inputprocessor.cc b/src/inputprocessor.cc index bdda466..3af203c 100644 --- a/src/inputprocessor.cc +++ b/src/inputprocessor.cc @@ -122,9 +122,9 @@ bool InputProcessor::processOnset(event_t& event, if(event_sample.group == instr->getGroup() && event_sample.instrument != instr) { - // Ramp down 14.7ms (3000 samples in 44k1Hz) - // FIXME: Isn't that a rampdown of 1000/14.7 ms? - event_sample.rampdown = settings.samplerate.load() / 14.7; + // Fixed ramp of 68ms, independent of samplerate + std::size_t ramp_length = (68./1000.)*settings.samplerate.load(); + event_sample.rampdown = ramp_length; // TODO: This must be configurable at some point... // ... perhaps even by instrument (ie. in the xml file) event_sample.ramp_start = event_sample.rampdown; -- cgit v1.2.3