clocker

while 'toggle' is true, 'clocker' is counting and spits out the current clock. if 'toggle' is false , 'clocker' puts out 0.
Author: robert schirmer
License: who cares
Github: rbrt/control/clocker.axo

Inlets

bool32.risingfalling clock is running or not

Outlets

int32 current time in k-rate ticks (0.333 ms)

Declaration
int32_t trigstart;
int32_t trigstop;
int tc;
Init
trigstart = 0;
trigstop = 0;
tc = 0;
Control Rate
if ((inlet_toggle) && !trigstart) {
  tc = 0;
  trigstart = 1;
} else if (!(inlet_toggle)) {
  trigstart = 0;
  tc = 0;
}

if (trigstart) {
  tc == tc++;
}
outlet_t = tc;

Privacy

© 2024 Zrna Research