dualEuclid

dual euclidian trigger generator produces a trigger after the amount of steps set by the denom 1 and 2 controls
Author: Remco van der Most
License: BSD
Github: sss/patt/dualEuclid.axo

Inlets

int32 nominator

Outlets

bool32 gate

Parameters

int32 denom1

int32 denom2

Declaration
int gate;
int prev;
Control Rate
int r;
if (inlet_a >= 0)
  r = ((unsigned int)inlet_a) / param_denom1;
else
  r = -(((unsigned int)(param_denom1 - inlet_a)) / param_denom1);
int s = r;
if (inlet_a >= 0)
  r = ((unsigned int)inlet_a) / param_denom2;
else
  r = -(((unsigned int)(param_denom2 - inlet_a)) / param_denom2);

if (!(prev == s + r)) {
  gate = (gate + 1) & 1;
}
prev = s + r;
outlet_gate = gate;

Privacy

© 2024 Zrna Research