sdemux1_2

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

Inlets

frac32buffer input

frac32.positive s

Outlets

frac32buffer output 0

frac32buffer output 1

Declaration
void proc(int32_t sel, int32_t *o0, int32_t *o1, const int32_t *in) {
  int32_t *s0, *s1;
  switch (sel >> (27 - 1)) {
  case 0:
    s0 = o0;
    s1 = o1;
    break;
  case 1:
    s0 = o1;
    s1 = o0;
    break;
  }
  int32_t a1 = (sel << 1) & 0x07FFFFFF;
  int32_t a0 = 0x07FFFFFF - a1;
  for (int i = 0; i < BUFSIZE; i++) {
    s0[i] = ___SMMUL(in[i], a0) << 5;
    s1[i] = ___SMMUL(in[i], a1) << 5;
  }
}
Control Rate
proc((inlet_s)&0x07FFFFFF, outlet_o0, outlet_o1, inlet_i);

Privacy

© 2024 Zrna Research