timer

while 'toggle' is true,timer is counting.. if 'toggle' is false,timer spits out the time
Author: robert schirmer
License: who cares
Github: rbrt/control/timer.axo

Inlets

bool32.risingfalling start counting,output the time interval

Outlets

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

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;
  outlet_t = tc;
}

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

Privacy

© 2024 Zrna Research