A Logic Cookbook for Synthesis

Variable PWM from a comparator

Attibution: DivKid, Luke Teaford

A comparator will only go high when a voltage crosses the threshold you set

A comparator outputs a binary (high or low) signal, indistinguishable from a pulse or gate stream. If you feed the comparator with a regular triangle, saw or ramp wave, you will get a regular pulse wave out of the comparator, and the width of the pulses will depend on the voltage the comparator is comparing the signal to.

Example:

Note: you can also use a mixer to combine your saw or ramp wave with an LFO signal, patch the result to the input of the comparator, and leave the comparator’s offset at zero to a somewhat similar effect.

This same general strategy can be used to add variable per-step gate length to any step sequencer. Use a step sequence to modulate the comparator, and clock the step sequence with the same saw wave you’re sending the comparator.

If you have access to a window comparator (e.g., Joranalogue Compare 2) and pass it a triangle wave as your input, by adjusting or modulating the parameters on the window comparator, you can create PWM with pairs of pulses that separate and combine, resulting in both PWM-style timbres and octave shifts.

Video example (begins at 3:19):

< Back

• • •