euclidToggle

Euclidian toggling gate generator Feed it a counter and it will toggle the gate everytime one of the denominators wraps the count
Author: Remco van der Most
License: BSD
Github: sss/patt/euclidToggle.axo

Inlets

int32 nominator

Outlets

bool32 gate

Parameters

int32 denom1

int32 denom2

int32 denom3

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);
int t = 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 + t)) {
  gate = (gate + 1) & 1;
}
prev = s + r + t;
outlet_gate = gate;

Privacy

© 2024 Zrna Research