smux4_1

Smooth multiplexer. Works like multiple cross fades.
Author: Smashed Transistors
License: LGPL
Github: tiar/mux/smux4_1.axo

Inlets

frac32buffer input 0

frac32buffer input 1

frac32buffer input 2

frac32buffer input 3

frac32.positive s

Outlets

frac32buffer output

Declaration
void proc(int32_t sel, const int32_t *i0, const int32_t *i1, const int32_t *i2,
          const int32_t *i3, int32_t *out) {
  const int32_t *s0, *s1;
  switch (sel >> (27 - 2)) {
  case 0:
    s0 = i0;
    s1 = i1;
    break;
  case 1:
    s0 = i1;
    s1 = i2;
    break;
  case 2:
    s0 = i2;
    s1 = i3;
    break;
  case 3:
    s0 = i3;
    s1 = i0;
    break;
  }
  int32_t a = (sel << 2) & 0x07FFFFFF;
  for (int i = 0; i < BUFSIZE; i++) {
    int32_t _s0 = s0[i];
    out[i] = ___SMMLA(a, s1[i] - _s0, _s0 >> 5) << 5;
  }
}
Control Rate
proc((inlet_s)&0x07FFFFFF, inlet_i0, inlet_i1, inlet_i2, inlet_i3, outlet_o);

Privacy

© 2024 Zrna Research