csoftdist

Soft distortion module to use with the chainFX effects chainer module. Controls can easily be editted for external control
Author: Remco van der Most
License: BSD
Github: sss/fx/chainer/csoftdist.axo

Inlets

None

Outlets

None

Parameters

frac32.u.map.gain volume

bool32.tgl bypass

bool32.tgl solo

frac32.u.map gain

Declaration
uint32_t v30 = (uint32_t)1 << 30;
uint32_t v26 = (uint32_t)1 << 26;
uint32_t v27 = (uint32_t)1 << 27;
int32_t outL;
int32_t outR;
int32_t hpL;
int32_t hpR;
int32_t IL;
int32_t IR;
uint32_t gain;
uint32_t volume;

bool bypass, solo;
int32_t FX(int32_t inL, int32_t inR, int32_t CV1, int32_t CV2) {
  IL = inL;
  IR = inR;
  int32_t GN1 = __SSAT(gain + CV1 + CV2, 28) << 4;
  int32_t GN2 = __SSAT(gain + CV1 - CV2, 28) << 4;
  hpL += inL - hpL >> 10;
  hpR += inR - hpR >> 10;
  inL -= hpL;
  inR -= hpR;

  inL = __SSAT(__SSAT(inL >> 7, 21) + __SSAT(___SMMUL(inL, GN1), 21), 21);
  inR = __SSAT(__SSAT(inR >> 7, 21) + __SSAT(___SMMUL(inR, GN2), 21), 21);
  inL = inL << 7;
  inR = inR << 7;
  outL = ___SMMUL(inL << 1, volume);
  outR = ___SMMUL(inR << 1, volume);
  if (bypass > 0) {
    outL = IL;
    outR = IR;
  }
};
Control Rate
gain = param_gain;
volume = param_volume;
bypass = param_bypass;
solo = param_solo;

Privacy

© 2024 Zrna Research