smthRotator

Smooth input rotator. Smoothly rotates all the inputs along the 8 outputs. This new version has a linear and exponential output-jump size, skipping outputs and so generating different patterns
Author: Remco van der Most
License: BSD
Github: sss/mux/smthRotator.axo

Inlets

frac32 input 0

frac32 input 1

frac32 input 2

frac32 input 3

frac32 i4

frac32 i5

frac32 i6

frac32 i7

frac32.positive s

Outlets

frac32 output

frac32 o1

frac32 o2

frac32 o3

frac32 o4

frac32 o5

frac32 o6

frac32 o7

Parameters

int32 jump

int32 exp

Control Rate
int32_t a1;
int32_t b1;
int32_t c1;
int32_t d1;
int32_t e1;
int32_t f1;
int32_t g1;
int32_t h1;
int32_t a2;
int32_t b2;
int32_t c2;
int32_t d2;
int32_t e2;
int32_t f2;
int32_t g2;
int32_t h2;
int32_t x;
int32_t y;

int32_t selectbase;
int32_t select1;
int32_t select2;
selectbase = ((inlet_s >> 24));
select1 =
    ((selectbase * param_jump) + ((selectbase * selectbase - 1) * param_exp)) &
    7;
select2 = (((selectbase + 1) * param_jump) +
           (((selectbase + 1) * (selectbase + 1) - 1) * param_exp)) &
          7;

switch (int(select1) > 0 ? select1 : 0) {
case 0:
  a1 = inlet_i0, b1 = inlet_i1, c1 = inlet_i2, d1 = inlet_i3, e1 = inlet_i4,
  f1 = inlet_i5, g1 = inlet_i6, h1 = inlet_i7;
  break;
case 1:
  a1 = inlet_i1, b1 = inlet_i2, c1 = inlet_i3, d1 = inlet_i4, e1 = inlet_i5,
  f1 = inlet_i6, g1 = inlet_i7, h1 = inlet_i0;
  break;
case 2:
  a1 = inlet_i2, b1 = inlet_i3, c1 = inlet_i4, d1 = inlet_i5, e1 = inlet_i6,
  f1 = inlet_i7, g1 = inlet_i0, h1 = inlet_i1;
  break;
case 3:
  a1 = inlet_i3, b1 = inlet_i4, c1 = inlet_i5, d1 = inlet_i6, e1 = inlet_i7,
  f1 = inlet_i0, g1 = inlet_i1, h1 = inlet_i2;
  break;
case 4:
  a1 = inlet_i4, b1 = inlet_i5, c1 = inlet_i6, d1 = inlet_i7, e1 = inlet_i0,
  f1 = inlet_i1, g1 = inlet_i2, h1 = inlet_i3;
  break;
case 5:
  a1 = inlet_i5, b1 = inlet_i6, c1 = inlet_i7, d1 = inlet_i0, e1 = inlet_i1,
  f1 = inlet_i2, g1 = inlet_i3, h1 = inlet_i4;
  break;
case 6:
  a1 = inlet_i6, b1 = inlet_i7, c1 = inlet_i0, d1 = inlet_i1, e1 = inlet_i2,
  f1 = inlet_i3, g1 = inlet_i4, h1 = inlet_i5;
  break;
case 7:
  a1 = inlet_i7, b1 = inlet_i0, c1 = inlet_i1, d1 = inlet_i2, e1 = inlet_i3,
  f1 = inlet_i4, g1 = inlet_i5, h1 = inlet_i6;
  break;
default:
  a1 = inlet_i0, b1 = inlet_i1, c1 = inlet_i2, d1 = inlet_i3, e1 = inlet_i4,
  f1 = inlet_i5, g1 = inlet_i6, h1 = inlet_i7;
  break;
}

switch (int(select2) > 0 ? select2 : 0) {
case 0:
  a2 = inlet_i0, b2 = inlet_i1, c2 = inlet_i2, d2 = inlet_i3, e2 = inlet_i4,
  f2 = inlet_i5, g2 = inlet_i6, h2 = inlet_i7;
  break;
case 1:
  a2 = inlet_i1, b2 = inlet_i2, c2 = inlet_i3, d2 = inlet_i4, e2 = inlet_i5,
  f2 = inlet_i6, g2 = inlet_i7, h2 = inlet_i0;
  break;
case 2:
  a2 = inlet_i2, b2 = inlet_i3, c2 = inlet_i4, d2 = inlet_i5, e2 = inlet_i6,
  f2 = inlet_i7, g2 = inlet_i0, h2 = inlet_i1;
  break;
case 3:
  a2 = inlet_i3, b2 = inlet_i4, c2 = inlet_i5, d2 = inlet_i6, e2 = inlet_i7,
  f2 = inlet_i0, g2 = inlet_i1, h2 = inlet_i2;
  break;
case 4:
  a2 = inlet_i4, b2 = inlet_i5, c2 = inlet_i6, d2 = inlet_i7, e2 = inlet_i0,
  f2 = inlet_i1, g2 = inlet_i2, h2 = inlet_i3;
  break;
case 5:
  a2 = inlet_i5, b2 = inlet_i6, c2 = inlet_i7, d2 = inlet_i0, e2 = inlet_i1,
  f2 = inlet_i2, g2 = inlet_i3, h2 = inlet_i4;
  break;
case 6:
  a2 = inlet_i6, b2 = inlet_i7, c2 = inlet_i0, d2 = inlet_i1, e2 = inlet_i2,
  f2 = inlet_i3, g2 = inlet_i4, h2 = inlet_i5;
  break;
case 7:
  a2 = inlet_i7, b2 = inlet_i0, c2 = inlet_i1, d2 = inlet_i2, e2 = inlet_i3,
  f2 = inlet_i4, g2 = inlet_i5, h2 = inlet_i6;
  break;
default:
  a2 = inlet_i0, b2 = inlet_i1, c2 = inlet_i2, d2 = inlet_i3, e2 = inlet_i4,
  f2 = inlet_i5, g2 = inlet_i6, h2 = inlet_i7;
  break;
}

x = inlet_s - ((inlet_s >> 24) << 24);
y = (1 << 24) - x;

outlet_o0 = ___SMMUL(y << 4, a1 << 4) + ___SMMUL(x << 4, a2 << 4);
outlet_o1 = ___SMMUL(y << 4, b1 << 4) + ___SMMUL(x << 4, b2 << 4);
outlet_o2 = ___SMMUL(y << 4, c1 << 4) + ___SMMUL(x << 4, c2 << 4);
outlet_o3 = ___SMMUL(y << 4, d1 << 4) + ___SMMUL(x << 4, d2 << 4);
outlet_o4 = ___SMMUL(y << 4, e1 << 4) + ___SMMUL(x << 4, e2 << 4);
outlet_o5 = ___SMMUL(y << 4, f1 << 4) + ___SMMUL(x << 4, f2 << 4);
outlet_o6 = ___SMMUL(y << 4, g1 << 4) + ___SMMUL(x << 4, g2 << 4);
outlet_o7 = ___SMMUL(y << 4, h1 << 4) + ___SMMUL(x << 4, h2 << 4);

Privacy

© 2024 Zrna Research