dca3

3 input dca
Author: Smashed Transistors
License: LGPL
Github: tiar/gain/dca3.axo

Inlets

frac32 g1

frac32 g2

frac32 g3

frac32buffer in1

frac32buffer in2

frac32buffer in3

Outlets

frac32buffer mix out

Declaration
bool i1, i2, i3;
int32_t g1, g2, g3;
Init
i1 = i2 = i3 = false;
g1 = g2 = g3 = 0;
Control Rate
for (int i = 0; i < BUFSIZE; i++) {
  int32_t in = inlet_in1[i];
  bool ic = in > 0;
  if (i1 != ic)
    g1 = inlet_g1;
  i1 = ic;
  outlet_out[i] = ___SMMUL(in, g1);
}
for (int i = 0; i < BUFSIZE; i++) {
  int32_t in = inlet_in2[i];
  bool ic = in > 0;
  if (i2 != ic)
    g2 = inlet_g2;
  i1 = ic;
  outlet_out[i] = ___SMMLA(in, g2, outlet_out[i]);
}
for (int i = 0; i < BUFSIZE; i++) {
  int32_t in = inlet_in3[i];
  bool ic = in > 0;
  if (i3 != ic)
    g3 = inlet_g3;
  i1 = ic;
  outlet_out[i] = ___SMMLA(in, g3, outlet_out[i]) << 5;
}

Privacy

© 2024 Zrna Research