campmod

Amplitude modulator module to use with the chainFX effects chainer module. Internal CV1 controls modulator pitch and CV2 controls modulator waveform (sine/saw) Controls can easily be editted for external control
Author: Remco van der Most
License: BSD
Github: sss/fx/chainer/campmod.axo

Inlets

None

Outlets

None

Parameters

frac32.s.map rate

frac32.u.map depth

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 pan;
int32_t hp;
bool bypass, solo;
int32_t SOFT(int32_t in) {
  int32_t ts = __SSAT(in, 28);
  int32_t tsq31 = ts << 3;
  int32_t tsq31p3 = ___SMMUL(tsq31, ___SMMUL(tsq31, tsq31));
  return ts = (ts + (ts >> 1) - (tsq31p3)) / 3 * 2;
}
int32_t FX(int32_t inL, int32_t inR, int32_t CV1, int32_t CV2) {
  phs += rate + (___SMMUL(rate, ___SMMUL(CV1, pan)) << 12) +
         (___SMMUL(rate, CV2) << 6);

  SINE2TINTERP(phs, pan)
  outL = inL >> 1;
  outR = inR >> 1;
  outL = SOFT(inL + (___SMMUL(pan, outL) << 2));
  outR = SOFT(inR + (___SMMUL(-pan, outR) << 2));
  pan = pan >> 5;
  hp += pan - hp >> 9;
  pan -= hp;
  if (bypass > 0) {
    outL = inL;
    outR = inR;
  }
};
Control Rate
depth = param_depth;
MTOFEXTENDED(param_rate, rate)
bypass = param_bypass;
solo = param_solo;

Privacy

© 2024 Zrna Research