csrr

simple sample rate reducer module with LP-damping 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/csrr.axo

Inlets

None

Outlets

None

Parameters

frac32.u.map rate

frac32.u.map damp

bool32.tgl bypass

bool32.tgl solo

Declaration
uint32_t v31 = (uint32_t)1 << 31;
uint32_t v30 = (uint32_t)1 << 30;
int32_t outL;
int32_t outR;
uint32_t phs;
int32_t rate;
int32_t depth;
int32_t TM;
int32_t F1;
int32_t F2;
int32_t FD;
int32_t lpL;
int32_t lpR;
int32_t hpL;
int32_t hpR;
int32_t freq;
int32_t FR;
bool bypass, solo;
int32_t FX(int32_t inL, int32_t inR, int32_t CV1, int32_t CV2) {
  MTOF(__SSAT((CV2 >> 1) * 0 + FR, 28), freq)
  CV1 = CV1 > 0 ? CV1 : -CV1;
  int32_t RT = ___SMMUL(__USAT(rate + CV1, 27), 500 << 5);
  // lpL=___SMMLA(inL-lpL<<1,freq,lpL);
  // lpR=___SMMLA(inR-lpR<<1,freq,lpR);

  phs += 23;
  if (phs > RT) {
    phs -= RT;
    // F1=lpL;
    // F2=lpR;
    F1 = inL * 3 >> 1;
    F2 = inR * 3 >> 1;
  }
  lpL = ___SMMLA(F1 - lpL << 1, freq, lpL);
  lpR = ___SMMLA(F2 - lpR << 1, freq, lpR);
  hpL += lpL - hpL >> 9;
  hpR += lpR - hpR >> 9;
  outL = lpL - hpL;
  outR = lpR - hpR;
  if (bypass > 0) {
    outL = inL;
    outR = inR;
  }
};
Init
phs = 0;
Control Rate
rate = param_rate;

FR = param_damp;
bypass = param_bypass;
solo = param_solo;

Privacy

© 2024 Zrna Research