Hi, Sorry for the probably trivial question (and probably badly formulated :-).
Often I have an event that is generated by an input from an external clock, that I detect using a schmittTrigger:
dsp::SchmittTrigger clockTrigger;
....
if (clockTrigger.process(inputs[CLOCK_INPUT].getVoltage())) {
... my stuff here ...
}
I can “propagate” easily that event to an output with a PulseGenerator:
... my stuff here ...
outpulse.trigger(1e-3f);
}
...
outputs[TRIG_OUTPUT].setVoltage( outpulse.process(args.sampleTime)? 10.0f : 0.f );
But what technique should I use if I want to output a gate signal, i.e. a signal that it is initially low, goes high at the first input pulse, then at the second input pulse it goes low and back to high (for enough time to be considered also as a trigger), and the same for the following pulses.
I can do it “manually” using a local variable and counting the time elapsed after I set it to low, but I don’t know what is the “standard” time to keep it low.