Stuck with a SynthEdit project?

Tag: Pulse Delay

Elena Designs DSP Timer.

DSP TIMER

Multi-function DSP bool timer to avoid usage of audio lines when they are really not needed, as in a clock oscillator running at around 1 Hz.
The module has a Bool trigger input and a bool signal output.
The two time intervals can be set on the T1 and T2 Plugs. T1 and T2 times can be specified in milliseconds or samples.
Note: The Module is programmed as a DSP Control, not an Audio Module. It will run at Audio rates, but at a high CPU cost- Always use an Audio Oscillator module! Likewise it should not be used as a Frequency divider at audio rates.


There are various modes of operation, which can be selected via the properties panel (Not Accessible via a plug); On Delay, Off Delay, On Pulse, Off Pulse, Bistable, and Pulse Train.

DSP Timer Operating Modes.

It’s best to read these slowly and thoroughly as there’s a fair amount to absorb!
On Delay :- The output plug goes high when receiving a trigger pulse after the time set via the T1 delay plug. If the Trigger plug goes “low” before T1 has expired the output will immediately return to the “Low” state. The Output will be held “High for as long as the Trigger is held “High”.

Off Delay:- The output plug goes high when receiving a trigger pulse, and will return to the “Low” state after the time set via the T1 delay plug. If trigger plug receives another “High input” before T1 has expired Timer will immediately be reset.

On Pulse:- When a Trigger pulse is received a single pulse of duration T2 will be output after the delay time T1 has passed after the trigger was received. Any further change in trigger state will be ignored until T2 has expired.
Note: T2 will be clipped to one sample length if it results or is set to zero samples, since a pulse length equaling zero samples long does not make sense.

Off Pulse:- When a trigger is received a single pulse of duration T2 will be output after a delay of T1 once the trigger returns to “Low”; any further change in trigger state is ignored until T2 has expired
Note: T2 will be clipped to one sample length if it results or is set to zero samples, since a zero sample long pulse does not make sense.

Bistable:– The Output is toggled every time a Trigger pulse is received.
Note: T1 and T2 are not used in this mode of operation.

Pulse Train:- While the Trigger plug is “high”, an pulse train (T1 = On duration, T2 = Off duration) is generated. When the Trigger plug goes “Low” the pulse train stops immediately. Useful as a Clock Oscillator.
Note: T1 and T2 will be clipped to one sample length if they result or are set to zero samples, since a zero samples long pulse does not make sense.

Note: Because of the CPU overhead involved with setting and transmitting DSP control pins at audio rate compared to that of using Audio pins, it is advisable not to use the Timer module as an Audio Oscillator (in the Pulse Train mode) with high frequencies. It is a much better method CPU wise to use an Audio oscillator for Audio purposes.

Clock Oscillator with full rate and half rate outputs.

This design uses two DSP timers, one set in Pulse Train mode to generate the clock pulse train. The pulse train has a fixed time of 50 mS and variable times between pulses of 100 mS to 10 S. Set via the slider properties using a minimum value of 100, and a maximum of 10,000. If required the pulse duration could be changed, or made variable.
The second DSP Timer is set to Bistable Mode to give an output a half the original clock rate.
The Run Button sends a “High” or “Low” signal to the Trigger plug to turn the timer module on and off

Other logic modules in Synthedit.

Monostable.

The correct electronics term for this module is a Monostable Multivibrator. The name derives from the fact that they have a default state of 0 volts output until they are triggered by an external pulse, they then flip to the on state (usually 5 volts) for a preset length of time, once this expires they then revert to their default of 0 volts output.
The monostable module operates on the same principle. It normally outputs a “False” or 0 logic state. Once the Monostable receives a pulse signal input the leading edge of the pulse triggers the monostable, the output of which then switches to the “True” or 1 logic condition.
The gate then holds the “True” condition for a period of time determined by the voltage present on the Pulse Length (ds)- (ds stands for DeciSeconds) plug. The Time to Voltage is 1 Volt = 10 seconds. See the demo screenshots below (the small voltages are because the demo setup has quite a high pulse rate)

Note: You’ll find that once the monostable has been triggered, it won’t respond to another trigger pulse until the preset time has elapsed. Trying to trigger it a second time will not extend the length of the output pulse, also no matter how long the input pulse this will not affect the length of the output pulse.

Monostable with a Pulse Length voltage of 0.0015 Volt
The effect of increasing the Pulse Length voltage to 0.0075 Volt

What use is a Monostable?

What use is a monostable? Well one possible use is the following:
Say we wanted to detect when our audio level passed 2 volts, and light an LED.
We can us a comparator to detect this, but say the audio only exceeds 2 V for a few milliseconds? That’s not enough time for the LED to respond, let alone for us to see it light up. This is where a Monostable is useful. By adding this to the output, and putting 5V on the Pulse length plug, we will detect the short lived peak, and the monostable will send a half second pulse to the LED- enough to see it flash and warn us the audio will be clipping

Comparator with variable pulse length output.

Delaying the Trigger pulse from a keyboard.

If you needed a delayed Keyboard Trigger pulse then this is one way to approach it. By not connecting the Gate pulse from MIDI-CV 2 to the ADSR 2 module then no matter how long you hold down a key only the attack/decay portions of the envelope will be active. The decay can be set to 0 V as it’s unimportant, as are the sustain and release portions.
Note: The overall Level plug is set to 10.2 volts, otherwise the structure isn’t reliable at triggering.
Input B of the comparator is set to 10 volts, so the comparator switches to + 10 volts output when Input A of the comparator reaches 10 volts, the monostable then generates a fixed length pulse from this providing us with a delayed Trigger pulse, the delay time being set by the Attack segment timing of the ADSR 2 module (the time it takes to reach 10 V). Because the Envelope isn’t held when the Attack reaches its maximum the resulting pulse is extremely short hence using the monostable on the output, which in this usage triggers another ADSR2 module.
Note: Always connect both Trigger and Gate plugs as shown.
Using this method we can create a delayed trigger as was used in the Moog modular synthesizers.
You don’t specifically need to use the Fixed Values modules (you can specify the values needed in the module properties), but it does make it easier to work out what you have done at a later date, and here it’s done for illustration purposes.

Delayed Envelope triggering