summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndré Nusser <andre.nusser@googlemail.com>2018-08-02 11:00:23 +0200
committerAndré Nusser <andre.nusser@googlemail.com>2018-08-02 11:00:23 +0200
commite39d82f5a06db9d4c4c505d30c4ac116037e1399 (patch)
tree1ed11fd5189361e68fce598cf1e23746a72ae7d6 /src
parent5910d25faf5574d763efbe8ecea7a7c4faac1918 (diff)
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. :)
Diffstat (limited to 'src')
-rw-r--r--src/inputprocessor.cc6
1 files 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;