This is a useful but sometimes misunderstood module (unless you have a background in electronics. I’m (hopefully) going to try and make it simpler to understand what they do and how to use them.
What a comparator actually does.
The comparator has one simple function. The name sort of gives it away really.
It has two inputs; Input A and Input B. We are basically comparing A with B and changing the output when A is greater than B.
Input A is normally a variable voltage, and Input B is a fixed or reference voltage. Say our reference (B) is 5 Volts, when Input A is greater than our reference of 5 volts the comparator will change its output from Low to High, if the value falls below the reference of 5 volts the output will change from High to Low.
Often these high and low values will be something like Low = 0 Volts, High = 5 Volts in line with hardware logic voltages.
With the SynthEdit Comparator module we have two further input plugs Hi Out Val, and Lo Out Val. with these we can set the High Value, and Low value that will be output. So if you wanted you could specify that when the comparator was triggered (or High) the output would be 3 Volts, and when it was not triggered (or Low) the output would be 6 volts. This makes the comparator quite a versatile tool for controlling signal flow and other modules.
What a comparator does not do.
It does not act as an amplifier or attenuator.
It does not change the frequency of audio.
Here’s some layouts to demonstrate what I’m talking about.
Below you can see a more visual demonstration with a Sinewave input.
Changing the reference value only changes the point at which we switch from low to high. The only effect on the output is the point at which we switch. To change the output levels we change the Hi out and Lo out values.
It’s quite easy using a comparator to create a variable width pulse from a waveform such as sine or triangle. Any time you want to compare two voltages to control another module, the comparator is your go-to module.
Example:-Gated Amplifier.
As the comparator itself doesn’t strictly pass audio through (unchanged anyway-it would be very distorted as it will just create a massively clipped version of the audio input) we can’t use it to pass audio through when the level exceeds the threshold voltage, but there’s an easy way to fix this, by creating a quite versatile gated amplifier by using a few extra modules.
The idea of this structure is to take an audio input, use the peak follower to calculate the maximum level of the audio input, and use this to compare to our threshold voltage, as soon as the level exceeds the threshold + 10 volts is sent to Input 2 of the Level Adj module (that’s our gate, 0 Volts on input 2 = no output, and 10 Volts on input 2 = Full volume.
The Attack and Decay sliders set how quickly the Peak Follower and thus the Comparator will respond to changes in level of the signal, and thus how quickly the gate will open after you exceed the threshold, and how quickly the gate will close after the input drops below the threshold. Attack/Decay times that are too fast will result in low frequencies becoming “glitchy” and sounding distorted.
Note-Audio Levels and Threshold voltage: Audio in Synthedit is at a default of -5 to +5 V volts peak to peak, so we only need a maximum of 5 Volts for the Maximum value on the slider (In reality you’ll probably want to set the threshold quite a bit lower than this).
Note-Threshold polarity: Although the audio input is -5 to +5V peak to peak, the output from our peak level detector is always positive, so the Threshold voltage should only be positive (-ve threshold voltage = permanent silence).
Of course you might want to reverse this and only pass signals below a threshold, to do this just reverse the values on the Hi/Lo Out Val plugs (Hi = 0V, Lo= 10V).