summaryrefslogtreecommitdiff
path: root/src/drumgizmo.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2018-08-05 16:21:04 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2018-08-05 16:21:04 +0200
commite517296012efd234c8991a7b1fef3db51da116be (patch)
tree7adc44019d76abdce23dfb24d21cecbe61faba9e /src/drumgizmo.cc
parenta0e2b9398a06ca2ea164c2ffd6fd89f713b93598 (diff)
Fix rampdown offsets.
Diffstat (limited to 'src/drumgizmo.cc')
-rw-r--r--src/drumgizmo.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/drumgizmo.cc b/src/drumgizmo.cc
index 81db5c5..5a201af 100644
--- a/src/drumgizmo.cc
+++ b/src/drumgizmo.cc
@@ -271,9 +271,10 @@ repeat:
assert(t >= 0);
assert(t < evt.buffer_size - evt.buffer_ptr);
- if(evt.rampdownInProgress() && evt.rampdown_count > 0)
+ if(evt.rampdownInProgress() && evt.rampdown_offset < (evt.t + t) &&
+ evt.rampdown_count > 0)
{
- scale = std::min((float)evt.rampdown_count/evt.ramp_length, 1.f);
+ scale = std::min((float)evt.rampdown_count / evt.ramp_length, 1.f);
evt.rampdown_count--;
}