diff --git a/src/AddrSeq.cpp b/src/AddrSeq.cpp index 584c3b13..ef292019 100644 --- a/src/AddrSeq.cpp +++ b/src/AddrSeq.cpp @@ -34,7 +34,7 @@ void AddrSeq::step() { bool timer = _timer.next(); bool clock = _clock.process(inputs[CLOCK_INPUT].value) && !timer; - int steps = params[STEPS_PARAM].value; + int steps = clamp(params[STEPS_PARAM].value, 1.0f, 8.0f); int reverse = 1 - 2 * (params[DIRECTION_PARAM].value == 0.0f); _step = (_step + reverse * clock) % steps; _step += (_step < 0) * steps; diff --git a/src/EightOne.cpp b/src/EightOne.cpp index c7829485..723200ad 100644 --- a/src/EightOne.cpp +++ b/src/EightOne.cpp @@ -34,7 +34,7 @@ void EightOne::step() { bool timer = _timer.next(); bool clock = _clock.process(inputs[CLOCK_INPUT].value) && !timer; - int steps = params[STEPS_PARAM].value; + int steps = clamp(params[STEPS_PARAM].value, 1.0f, 8.0f); int reverse = 1 - 2 * (params[DIRECTION_PARAM].value == 0.0f); _step = (_step + reverse * clock) % steps; _step += (_step < 0) * steps; diff --git a/src/OneEight.cpp b/src/OneEight.cpp index 88f95a81..5083c332 100644 --- a/src/OneEight.cpp +++ b/src/OneEight.cpp @@ -34,7 +34,7 @@ void OneEight::step() { bool timer = _timer.next(); bool clock = _clock.process(inputs[CLOCK_INPUT].value) && !timer; - int steps = params[STEPS_PARAM].value; + int steps = clamp(params[STEPS_PARAM].value, 1.0f, 8.0f); int reverse = 1 - 2 * (params[DIRECTION_PARAM].value == 0.0f); _step = (_step + reverse * clock) % steps; _step += (_step < 0) * steps;