summaryrefslogtreecommitdiff
path: root/src/staminafilter.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2018-07-10 20:46:44 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2018-07-15 18:56:01 +0200
commit34578fdef6a9f77aa285501130be55fcd560c03d (patch)
treedf7336fb49652c4e34297d6a53a7cc239e0ddd99 /src/staminafilter.cc
parentbe9fe821ff1689ece9ee6433fcf42ec316e0aaad (diff)
Use more sane range for stddev knob in UI.
Diffstat (limited to 'src/staminafilter.cc')
-rw-r--r--src/staminafilter.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/staminafilter.cc b/src/staminafilter.cc
index aadfd2d..8fdbfbb 100644
--- a/src/staminafilter.cc
+++ b/src/staminafilter.cc
@@ -76,7 +76,16 @@ bool StaminaFilter::filter(event_t& event, size_t pos)
mod *= velocity_modifier_weight;
}
- settings.velocity_modifier_current.store(mod);
+ {
+ auto velocity_modifier_current = settings.velocity_modifier_current.load();
+ float p = 0.9f;
+ float new_value = mod * p + velocity_modifier_current * (1.0f - p);
+ if(mod > new_value)
+ {
+ new_value = mod;
+ }
+ settings.velocity_modifier_current.store(new_value);
+ }
return true;
}