softstack

stackable symetrical soft saturation distortion: y=1.5*x-0.5*x^3 for -1<x<1, y=-1 for x<-1, y=1 for x>1, no oversampling or anti-aliasing
Author: Remco van der Most
License: BSD
Github: sss/dist/softstack.axo

Inlets

frac32buffer audio input

Outlets

frac32buffer.bipolar audio output

Parameters

int32 stack

Declaration
int32_t SOFT(int32_t in, int stack) {
  for (int i = 0; i < stack; i++) {
    int32_t ts = in;
    int32_t tsq31 = ts << 3;
    int32_t tsq31p3 = ___SMMUL(tsq31, ___SMMUL(tsq31, tsq31));
    in = ts + (ts >> 1) - (tsq31p3);
  }
  return in;
}
Audio Rate
int32_t tmp = __SSAT(inlet_in, 28);
tmp = SOFT(tmp, param_stack);

outlet_out = tmp;

Privacy

© 2024 Zrna Research