steptoggle

useful for step sequencing.if the table at index '+a' == 0 , index 'a+' will be set to value 'v'. if 'a+' is NOT 0, it will be set to 0.
Author: robert schirmer
License: who cares
Github: rbrt/old/steptoggle.axo

Inlets

int32.positive index (integer, not fraction)

frac32 step value if on

bool32 toggle step

Outlets

bool32 state of step

Attributes

objref table

Declaration
int ntrig;
bool op;
Init
int ntrig = 0;
Control Rate
if ((inlet_trig > 0) && !ntrig) {
  ntrig = 1;
  op = attr_table.array[inlet_a];
  op = !op;
  if (inlet_a < attr_table.LENGTH)
    attr_table.array[inlet_a] = (op * (__SSAT(inlet_v, 28) >> attr_table.GAIN));
}
if (!(inlet_trig > 0)) {
  ntrig = 0;
}

outlet_feedback = attr_table.array[inlet_a];

Privacy

© 2024 Zrna Research