summaryrefslogtreecommitdiffstats
path: root/src/libs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs')
-rw-r--r--src/libs/engine/AudioBuffer.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libs/engine/AudioBuffer.cpp b/src/libs/engine/AudioBuffer.cpp
index 5eea7103..098103c0 100644
--- a/src/libs/engine/AudioBuffer.cpp
+++ b/src/libs/engine/AudioBuffer.cpp
@@ -135,10 +135,12 @@ AudioBuffer::set_value(Sample val, FrameTime cycle_start, FrameTime time)
FrameTime offset = time - cycle_start;
assert(offset <= _size);
- set_block(val, offset, _size - 1);
-
- if (offset > 0)
- _state = HALF_SET_CYCLE_1;
+ if (offset < _size) {
+ set_block(val, offset, _size - 1);
+
+ if (offset > 0)
+ _state = HALF_SET_CYCLE_1;
+ } // else trigger at very end of block
_set_time = time;
_set_value = val;