modmatrix

modulation matrix. 'amp' crossfades between the selected inlet ('target') and the value at inlet 'mod'.
Author: Robert Schirmer
License: BSD
Github: rbrt/control/modmatrix.axo

Inlets

frac32 modulation amount

frac32 modulation input

frac32 i0

frac32 i1

frac32 i2

frac32 i3

frac32 i4

frac32 i5

frac32 i6

frac32 i7

int32 modulation target

Outlets

frac32 output

frac32 o1

frac32 o2

frac32 o3

frac32 o4

frac32 o5

frac32 o6

frac32 o7

frac32 mod

Declaration
int mod;
int src;
Control Rate
switch (inlet_target > 0 ? inlet_target : 0) {
case 0:
  src = inlet_i0;
  break;
case 1:
  src = inlet_i1;
  break;
case 2:
  src = inlet_i2;
  break;
case 3:
  src = inlet_i3;
  break;
case 4:
  src = inlet_i4;
  break;
case 5:
  src = inlet_i5;
  break;
case 6:
  src = inlet_i6;
  break;
case 7:
  src = inlet_i7;
  break;
default:
  src = inlet_i7;
  break;
}

{
  int64_t a = (int64_t)inlet_mod * inlet_amp;
  a += (int64_t)src * ((128 << 20) - inlet_amp);
  mod = a >> 27;
}

outlet_o0 = (inlet_target == 0) ? mod : inlet_i0;
outlet_o1 = (inlet_target == 1) ? mod : inlet_i1;
outlet_o2 = (inlet_target == 2) ? mod : inlet_i2;
outlet_o3 = (inlet_target == 3) ? mod : inlet_i3;

outlet_o4 = (inlet_target == 4) ? mod : inlet_i4;
outlet_o5 = (inlet_target == 5) ? mod : inlet_i5;
outlet_o6 = (inlet_target == 6) ? mod : inlet_i6;
outlet_o7 = (inlet_target == 7) ? mod : inlet_i7;

outlet_mod = mod;

Privacy

© 2024 Zrna Research