distMix4

4 input s-rate mixer, square gain scale with a nasty distortion Pairs very well with the sss/edrum/DR5 module!
Author: Remco van der Most
License: BSD
Github: sss/mix/distMix4.axo

Inlets

frac32buffer input 1

frac32buffer input 2

frac32buffer input 3

frac32buffer input 4

Outlets

frac32buffer mix out

Parameters

frac32.u.map.squaregain gain1

frac32.u.map.squaregain gain2

frac32.u.map.squaregain gain3

frac32.u.map.squaregain gain4

frac32.s.map.pitch center

frac32.s.map modC

frac32.s.map shelf

frac32.s.map modS

bool32.tgl absD1

bool32.tgl absD2

bool32.tgl absC

bool32.tgl absS

Declaration
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);
}
int32_t lp;
Audio Rate
int32_t a1 = ___SMMUL(__SSAT(inlet_in1, 28) << 3, __USAT(param_gain1, 29));
a1 += ___SMMUL(__SSAT(inlet_in2, 28) << 3, __USAT(param_gain2, 29));
a1 += ___SMMUL(__SSAT(inlet_in3, 28) << 3, __USAT(param_gain3, 29));
a1 += ___SMMUL(__SSAT(inlet_in4, 28) << 3, __USAT(param_gain4, 29));
int32_t in1 = SOFT(___SMMUL(__SSAT(inlet_in1, 28) << 3, param_gain1));
int32_t in2 = SOFT(___SMMUL(__SSAT(inlet_in2, 28) << 3, param_gain2));
int32_t in3 = SOFT(___SMMUL(__SSAT(inlet_in3, 28) << 3, param_gain3));
int32_t in4 = SOFT(___SMMUL(__SSAT(inlet_in4, 28) << 3, param_gain4));
in1 += in2 + in3 + in4 - a1;
if (param_absD2 > 0) {
  in1 = in1 > 0 ? in1 : -in1;
}
int32_t frq;
int32_t m1 = a1;
if (param_absC > 0) {
  m1 = m1 > 0 ? m1 : -m1;
}
MTOF(param_center + ((___SMMUL(param_modC, m1) << 6)), frq)

lp = ___SMMLA(in1 - lp << 1, frq, lp);
in2 = (lp << 1) - (in1);
if (param_absD1 > 0) {
  in2 = in2 > 0 ? in2 : -in2;
}
int32_t m2 = a1;
if (param_absS > 0) {
  m2 = m2 > 0 ? m2 : -m2;
}
int32_t accum =
    SOFT(a1 + in1 +
         (___SMMUL(param_shelf + (___SMMUL(param_modS, m2) << 5), in2) << 6));

outlet_out = accum;

Privacy

© 2024 Zrna Research