accumulatorsimple

Saturating accumulator. Adds input to accumulator when signal is positive, resets when signal is 0 or negative.
Author: Simon Iten
License: BSD
Github: lokki/math/accumulatorsimple.axo

Inlets

frac32buffer i

frac32buffer trigandrst

Outlets

frac32buffer o

Declaration
int accu;
Init
accu = 0;
Audio Rate
if ((inlet_trigandrst > 0)) {
  accu += inlet_i;
  accu = __SSAT(accu, 28);
} else {
  accu = 0;
}
outlet_o = accu;

Privacy

© 2024 Zrna Research