dualBezShape

dual bezier curve shaper. One for position, the other for level.
Author: Remco van der Most
License: BSD
Github: sss/osc/dualBezShape.axo

Inlets

frac32buffer.positive Phase Input

frac32 Parameter 1a

frac32 Parameter 1b

frac32 Parameter 1c

frac32 Parameter 2a

frac32 Parameter 2b

frac32 Parameter 2c

Outlets

frac32buffer output

frac32buffer phase

Audio Rate
{
  int(x1) = inlet_phase;
  int(y1) = ((128 << 20) - inlet_phase);
  int p0 = (int64_t)inlet_i0;
  int p1 = (int64_t)inlet_i1;
  int p2 = (int64_t)inlet_i2;
  int p3 = (int64_t)inlet_i0 - inlet_i1;
  int p4 = (int64_t)inlet_i0;

  int x2 = ___SMMUL(x1 << 3, x1 << 2);
  int x3 = ___SMMUL(x2 << 3, x1 << 2);
  int x4 = ___SMMUL(x3 << 3, x1 << 2);
  int y2 = ___SMMUL(y1 << 3, y1 << 2);
  int y3 = ___SMMUL(y2 << 3, y1 << 2);
  int y4 = ___SMMUL(y3 << 3, y1 << 2);

  int a = ___SMMUL(y4 << 3, p0 << 3);
  int b = ___SMMUL(x1 << 4, ___SMMUL(y3 << 3, p1 << 3) << 1) * 4;
  int c = ___SMMUL(x2 << 4, ___SMMUL(y2 << 3, p2 << 3) << 1) * 6;
  int d = ___SMMUL(x3 << 4, ___SMMUL(y1 << 3, p3 << 3) << 1) * 4;
  int e = ___SMMUL(x4 << 3, p4 << 3);
  int f = (inlet_phase + a + b + c + d + e) & ((1 << 27) - 1);

  int(r1) = f;
  int(t1) = ((128 << 20) - f);
  int q0 = (int64_t)inlet_j0;
  int q1 = (int64_t)inlet_j1;
  int q2 = (int64_t)inlet_j2;
  int q3 = (int64_t)inlet_j0 - inlet_j1;
  int q4 = (int64_t)inlet_j0;

  int r2 = ___SMMUL(r1 << 3, r1 << 2);
  int r3 = ___SMMUL(r2 << 3, r1 << 2);
  int r4 = ___SMMUL(r3 << 3, r1 << 2);
  int t2 = ___SMMUL(t1 << 3, t1 << 2);
  int t3 = ___SMMUL(t2 << 3, t1 << 2);
  int t4 = ___SMMUL(t3 << 3, t1 << 2);

  int g = ___SMMUL(t4 << 3, q0 << 2);
  int h = ___SMMUL(r1 << 4, ___SMMUL(t3 << 3, q1 << 3) << 1) * 4;
  int i = ___SMMUL(r2 << 4, ___SMMUL(t2 << 3, q2 << 3) << 1) * 6;
  int j = ___SMMUL(r3 << 4, ___SMMUL(t1 << 3, q3 << 3) << 1) * 4;
  int k = ___SMMUL(r4 << 3, q4 << 2);
  int l = (inlet_phase + g + h + i + j + k) & ((1 << 27) - 1);
  int32_t r;
  SINE2TINTERP(l << 5, r)

  outlet_o = (r >> 6);
  outlet_phase = l;
}

Privacy

© 2024 Zrna Research