mux 12

input multiplexer. Output is i1 when s < 1, i[i] when....
Author: Are Leistad
License: BSD
Github: drj/mux/mux 12.axo

IO Variants: 5


Variant: 1

Inlets

bool32 input 0

bool32 input 1

bool32 input 2

bool32 input 3

bool32 input 4

bool32 input 5

bool32 input 6

bool32 input 7

bool32 input 8

bool32 input 9

bool32 input 10

bool32 input 11

int32.positive select

Outlets

bool32 output

Control Rate
switch (inlet_s > 0 ? inlet_s : 0) {
case 0:
  outlet_o = inlet_i0;
  break;
case 1:
  outlet_o = inlet_i1;
  break;
case 2:
  outlet_o = inlet_i2;
  break;
case 3:
  outlet_o = inlet_i3;
  break;
case 4:
  outlet_o = inlet_i4;
  break;
case 5:
  outlet_o = inlet_i5;
  break;
case 6:
  outlet_o = inlet_i6;
  break;
case 7:
  outlet_o = inlet_i7;
  break;
case 8:
  outlet_o = inlet_i8;
  break;
case 9:
  outlet_o = inlet_i9;
  break;
case 10:
  outlet_o = inlet_i10;
  break;
case 11:
  outlet_o = inlet_i11;
  break;
default:
  outlet_o = inlet_i11;
  break;
}

Variant: 2

Inlets

charptr32 input 0

charptr32 input 1

charptr32 input 2

charptr32 input 3

charptr32 input 4

charptr32 input 5

charptr32 input 6

charptr32 input 7

charptr32 input 8

charptr32 input 9

charptr32 input 10

charptr32 input 11

int32.positive select

Outlets

charptr32 output

Control Rate
switch (inlet_s > 0 ? inlet_s : 0) {
case 0:
  outlet_o = (char *)inlet_i0;
  break;
case 1:
  outlet_o = (char *)inlet_i1;
  break;
case 2:
  outlet_o = (char *)inlet_i2;
  break;
case 3:
  outlet_o = (char *)inlet_i3;
  break;
case 4:
  outlet_o = (char *)inlet_i4;
  break;
case 5:
  outlet_o = (char *)inlet_i5;
  break;
case 6:
  outlet_o = (char *)inlet_i6;
  break;
case 7:
  outlet_o = (char *)inlet_i7;
  break;
case 8:
  outlet_o = (char *)inlet_i8;
  break;
case 9:
  outlet_o = (char *)inlet_i9;
  break;
case 10:
  outlet_o = (char *)inlet_i10;
  break;
case 11:
  outlet_o = (char *)inlet_i11;
  break;
default:
  outlet_o = (char *)inlet_i11;
  break;
}

Variant: 3

Inlets

int32.positive select

frac32buffer input 0

frac32buffer input 1

frac32buffer input 2

frac32buffer input 3

frac32buffer input 4

frac32buffer input 5

frac32buffer input 6

frac32buffer input 7

frac32buffer input 8

frac32buffer input 9

frac32buffer input 10

frac32buffer input 11

Outlets

frac32buffer output

Audio Rate
switch (inlet_s > 0 ? inlet_s : 0) {
case 0:
  outlet_o = inlet_i0;
  break;
case 1:
  outlet_o = inlet_i1;
  break;
case 2:
  outlet_o = inlet_i2;
  break;
case 3:
  outlet_o = inlet_i3;
  break;
case 4:
  outlet_o = inlet_i4;
  break;
case 5:
  outlet_o = inlet_i5;
  break;
case 6:
  outlet_o = inlet_i6;
  break;
case 7:
  outlet_o = inlet_i7;
  break;
case 8:
  outlet_o = inlet_i8;
  break;
case 9:
  outlet_o = inlet_i9;
  break;
  // 24.11.2017 19:51
  // BUG in 1.0.12
  //  For the audio rate sample buffer inlet type, the patcher mangles the
  //  building of the patch source when an input has a name that ends in a
  //  number with more than 2 digits.
  //
  //  Use "mux 12b" as a temprary work around until the patcher has been fixed.
  //
  // In the code below
  //      case 10: outlet_o= inlet_i10;break;
  //      case 11: outlet_o= inlet_i11;break;
  //      default: outlet_o= inlet_i11;break;
  // becomes:
  //      case 10: outlet_o[buffer_index]= inlet_i1[buffer_index]0;break;
  //      case 11: outlet_o[buffer_index]= inlet_i1[buffer_index]1;break;
  //      default: outlet_o[buffer_index]= inlet_i1[buffer_index]1;break;
  // when the patch source is built:

case 10:
  outlet_o = inlet_i10;
  break;
case 11:
  outlet_o = inlet_i11;
  break;
default:
  outlet_o = inlet_i11;
  break;
}

Variant: 4

Inlets

frac32 input 0

frac32 input 1

frac32 input 2

frac32 input 3

frac32 input 4

frac32 input 5

frac32 input 6

frac32 input 7

frac32 input 8

frac32 input 9

frac32 input 10

frac32 input 11

int32.positive select

Outlets

frac32 output

Control Rate
switch (inlet_s > 0 ? inlet_s : 0) {
case 0:
  outlet_o = inlet_i0;
  break;
case 1:
  outlet_o = inlet_i1;
  break;
case 2:
  outlet_o = inlet_i2;
  break;
case 3:
  outlet_o = inlet_i3;
  break;
case 4:
  outlet_o = inlet_i4;
  break;
case 5:
  outlet_o = inlet_i5;
  break;
case 6:
  outlet_o = inlet_i6;
  break;
case 7:
  outlet_o = inlet_i7;
  break;
case 8:
  outlet_o = inlet_i8;
  break;
case 9:
  outlet_o = inlet_i9;
  break;
case 10:
  outlet_o = inlet_i10;
  break;
case 11:
  outlet_o = inlet_i11;
  break;
default:
  outlet_o = inlet_i11;
  break;
}

Variant: 5

Inlets

int32 input 0

int32 input 1

int32 input 2

int32 input 3

int32 input 4

int32 input 5

int32 input 6

int32 input 7

int32 input 8

int32 input 9

int32 input 10

int32 input 11

int32.positive select

Outlets

int32 output

Control Rate
switch (inlet_s > 0 ? inlet_s : 0) {
case 0:
  outlet_o = inlet_i0;
  break;
case 1:
  outlet_o = inlet_i1;
  break;
case 2:
  outlet_o = inlet_i2;
  break;
case 3:
  outlet_o = inlet_i3;
  break;
case 4:
  outlet_o = inlet_i4;
  break;
case 5:
  outlet_o = inlet_i5;
  break;
case 6:
  outlet_o = inlet_i6;
  break;
case 7:
  outlet_o = inlet_i7;
  break;
case 8:
  outlet_o = inlet_i8;
  break;
case 9:
  outlet_o = inlet_i9;
  break;
case 10:
  outlet_o = inlet_i10;
  break;
case 11:
  outlet_o = inlet_i11;
  break;
default:
  outlet_o = inlet_i11;
  break;
}

Privacy

© 2024 Zrna Research