pulselengthI

Generates a single pulse after a rising edge on trigger input. A new trigger before the pulse finishes at the output, creates a zero pulse before it goes high again for retriggering.
Author: Remco van der Most
License: BSD
Github: sss/timing/pulselengthI.axo

Inlets

bool32.rising trigger

frac32 length

Outlets

bool32 pulse output

Parameters

frac32.s.map.klineartime.exp delay

Declaration
int32_t val;
int ntrig;
Init
val = 0;
ntrig = 0;
Control Rate
if (val > 0) {
  int32_t t;
  MTOF(-param_delay - inlet_length, t);
  val -= t >> 3;
  outlet_pulse = 1;
} else if (val <= 0) {
  outlet_pulse = 0;
}
if ((inlet_trig > 0) && !ntrig) {
  val = 1 << 30;
  ntrig = 1;
  outlet_pulse = 0;
} else if (!(inlet_trig > 0)) {
  ntrig = 0;
}

Privacy

© 2024 Zrna Research