Browse Source

Fix bug where Rampage would cycle in unstable fashion #44

pull/46/head
hemmer 1 year ago
parent
commit
a5c366751a
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      src/Rampage.cpp

+ 3
- 2
src/Rampage.cpp View File

@@ -240,8 +240,9 @@ struct Rampage : Module {
float shape = params[SHAPE_A_PARAM + part].getValue();
out[part][c / 4] += shapeDelta(delta, rate, shape) * args.sampleTime;

float_4 rising = (in[c / 4] - out[part][c / 4]) > 1e-3f;
float_4 falling = (in[c / 4] - out[part][c / 4]) < -1e-3f;
float_4 rising = simd::ifelse(delta_gt_0, (in[c / 4] - out[part][c / 4]) > 1e-3f, float_4::zero());
float_4 falling = simd::ifelse(delta_lt_0, (in[c / 4] - out[part][c / 4]) < -1e-3f, float_4::zero());

float_4 end_of_cycle = simd::andnot(falling, delta_lt_0);

endOfCyclePulse[part][c / 4].trigger(end_of_cycle, 1e-3);


Loading…
Cancel
Save