stimer

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

Inlets

bool32.risingfalling start counting,output the time interval

Outlets

int32 time interval in samples/ 48 khz

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 << 4;
}

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

Privacy

© 2024 Zrna Research