Gate signal implementation

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.

1 Like

I don’t know if there is a standard for putting a drop into a gate.

But there is a standard for triggers, which is 1ms, so it would make sense to me to drop the gate for 1ms.

I would be tempted to use a dsp::PulseGenerator for timing that.

1 Like

I was about to say the same thing. I use 1 ms. For a gate retrigger in my sequencers.

1 Like

my module elsker outputs timed gates

of course I designed a special class similar to the pulser but containing a chrono

1 Like