demux 4

Demultiplexer. Connects inlet i to outlet number s. Other outlets copy their corresponding default inlets.
Author: Johannes Taelman
License: BSD
Github: demux/demux 4.axo

IO Variants: 4


Variant: 1

Inlets

bool32 input

bool32 default 0

bool32 default 1

bool32 default 2

bool32 default 3

int32.positive select

Outlets

bool32 output 0

bool32 output 1

bool32 output 2

bool32 output 3

Control Rate
switch (inlet_s > 0 ? inlet_s : 0) {
case 0:
  outlet_o0 = inlet_i;
  outlet_o1 = inlet_d1;
  outlet_o2 = inlet_d2;
  outlet_o3 = inlet_d3;
  break;
case 1:
  outlet_o0 = inlet_d0;
  outlet_o1 = inlet_i;
  outlet_o2 = inlet_d2;
  outlet_o3 = inlet_d3;
  break;
case 2:
  outlet_o0 = inlet_d0;
  outlet_o1 = inlet_d1;
  outlet_o2 = inlet_i;
  outlet_o3 = inlet_d3;
  break;
case 3:
  outlet_o0 = inlet_d0;
  outlet_o1 = inlet_d1;
  outlet_o2 = inlet_d2;
  outlet_o3 = inlet_i;
  break;
default:
  outlet_o0 = inlet_d0;
  outlet_o1 = inlet_d1;
  outlet_o2 = inlet_d2;
  outlet_o3 = inlet_d3;
}

Variant: 2

Inlets

int32 input

int32 default 0

int32 default 1

int32 default 2

int32 default 3

int32.positive select

Outlets

int32 output 0

int32 output 1

int32 output 2

int32 output 3

Control Rate
switch (inlet_s > 0 ? inlet_s : 0) {
case 0:
  outlet_o0 = inlet_i;
  outlet_o1 = inlet_d1;
  outlet_o2 = inlet_d2;
  outlet_o3 = inlet_d3;
  break;
case 1:
  outlet_o0 = inlet_d0;
  outlet_o1 = inlet_i;
  outlet_o2 = inlet_d2;
  outlet_o3 = inlet_d3;
  break;
case 2:
  outlet_o0 = inlet_d0;
  outlet_o1 = inlet_d1;
  outlet_o2 = inlet_i;
  outlet_o3 = inlet_d3;
  break;
case 3:
  outlet_o0 = inlet_d0;
  outlet_o1 = inlet_d1;
  outlet_o2 = inlet_d2;
  outlet_o3 = inlet_i;
  break;
default:
  outlet_o0 = inlet_d0;
  outlet_o1 = inlet_d1;
  outlet_o2 = inlet_d2;
  outlet_o3 = inlet_d3;
}

Variant: 3

Inlets

frac32buffer input

frac32buffer default 0

frac32buffer default 1

frac32buffer default 2

frac32buffer default 3

int32.positive select

Outlets

frac32buffer output 0

frac32buffer output 1

frac32buffer output 2

frac32buffer output 3

Audio Rate
switch (inlet_s > 0 ? inlet_s : 0) {
case 0:
  outlet_o0 = inlet_i;
  outlet_o1 = inlet_d1;
  outlet_o2 = inlet_d2;
  outlet_o3 = inlet_d3;
  break;
case 1:
  outlet_o0 = inlet_d0;
  outlet_o1 = inlet_i;
  outlet_o2 = inlet_d2;
  outlet_o3 = inlet_d3;
  break;
case 2:
  outlet_o0 = inlet_d0;
  outlet_o1 = inlet_d1;
  outlet_o2 = inlet_i;
  outlet_o3 = inlet_d3;
  break;
case 3:
  outlet_o0 = inlet_d0;
  outlet_o1 = inlet_d1;
  outlet_o2 = inlet_d2;
  outlet_o3 = inlet_i;
  break;
default:
  outlet_o0 = inlet_d0;
  outlet_o1 = inlet_d1;
  outlet_o2 = inlet_d2;
  outlet_o3 = inlet_d3;
}

Variant: 4

Inlets

frac32 input

frac32 default 0

frac32 default 1

frac32 default 2

frac32 default 3

int32.positive select

Outlets

frac32 output 0

frac32 output 1

frac32 output 2

frac32 output 3

Control Rate
switch (inlet_s > 0 ? inlet_s : 0) {
case 0:
  outlet_o0 = inlet_i;
  outlet_o1 = inlet_d1;
  outlet_o2 = inlet_d2;
  outlet_o3 = inlet_d3;
  break;
case 1:
  outlet_o0 = inlet_d0;
  outlet_o1 = inlet_i;
  outlet_o2 = inlet_d2;
  outlet_o3 = inlet_d3;
  break;
case 2:
  outlet_o0 = inlet_d0;
  outlet_o1 = inlet_d1;
  outlet_o2 = inlet_i;
  outlet_o3 = inlet_d3;
  break;
case 3:
  outlet_o0 = inlet_d0;
  outlet_o1 = inlet_d1;
  outlet_o2 = inlet_d2;
  outlet_o3 = inlet_i;
  break;
default:
  outlet_o0 = inlet_d0;
  outlet_o1 = inlet_d1;
  outlet_o2 = inlet_d2;
  outlet_o3 = inlet_d3;
}

Privacy

© 2024 Zrna Research