Just for example you may be using something like the Waveshaper2B and want to allow the user of the VST to switch between different equations to change the wave-shaping effect.
There’s no need for any elaborate structures using PatchMem modules where you need to convert between GUI and DSP. It’s all easily done with GUI modules.
All we need is our pre-defined strings saved in the Fixed Values(Text) modules, and a drop down list added to select the required equation.
Don’t forget that by re naming the plugs on the switch module you’ll create a list of names to select from in the drop down list, otherwise you’ll end up with a list filled with “Spare”.
Month: March 2024
A VCA, or Voltage-Controlled Amplifier module, lets you use a voltage to control the amount of an audio signal that is allowed to pass through from the input to the output of the module.
The higher the control voltage, the more signal is passed. In SynthEdit when the control voltage reaches 10V the entire signal is let through, and when the control voltage is 0V (or below), no signal is passed and the output is silent.
VCA or Level Adj. Which should I use?
While you could use the Level Adj module in place of the VCA, there are differences between the two modules. The VCA has a slightly faster response time to its Volume plug than Input2 on the Level Adj module. Also without conversion you’ll only get a linear response to the envelope, as opposed to the choice of curves for the VCA. Strictly speaking the Level Adj module is an audio voltage multiplier. When controlling audio volume or applying an audio envelope for best results the VCA should always be used.
The Level Adj module multiplies one input by the other. It can be used for ring modulation, or for amplitude modulation, or for scaling a signal/CV by a fixed amount. The two inputs are multiplied together, then normalised. (e.g. 5V multiplied by 2 V = 1V, (5 * 2 ) / 10).
Uses for a VCA module.
Volume Control
You can use your VCA to turn just about anything into a volume/level control.
Run your audio signal through it, then connect the CV input to a mod wheel, or any voltage source you want.
Envelope Shaping
One of the most common uses of a VCA is envelope shaping. Think about when you hit a key on a piano; the amplitude starts out pretty loud, then over time it fades away. If you let go of the key then the volume drops off pretty quickly. You can use a VCA in conjunction with an envelope generator to achieve the same effect with notes on your synthesizer.
An envelope generator (EG) is a module or circuit that generates a voltage that is triggered by something and changes over time. If you’re trying to mimic a piano, you can configure the EG so that it is triggered by a key being pressed on your keyboard, it sends out a strong voltage at first, then it fades down to 0 over time.
The voltage sent out by the EG matches the way you want your amplitude to change over time. Connect the output of the EG into the CV input of your VCA and it will cause the amplitude of your note to fade out like a piano note.
The structure shown below illustrates a typical ADSR/VCA combination to trigger an audio envelope from a MIDI input
The VCA response curve modes:
The VCA Module allows you to choose from 3 different response curves via a drop down list, or a selection in the VCA module properties:
1) Linear
2) Exponential
3) Decibel
4) Decibel (Old)
The following chart shows the relationship between input and output voltages
A more useful graph is the output volume in decibels for a given input voltage. This shows more accurately how loud the signal sounds in relation to the control, voltage (below).
This graph shows that volume plug input of 10 Volts produces full volume (or 0 Decibels), and an input of 0 volts effectively gives silence (-70 decibels, very quiet).
A full-scale audio input signal is -10 to +10 Volts.
The normal output range of SynthEdit’s Oscillators is -5 to +5 Volts (about -6dB).
Note: SynthEdit’s own VU Meter module displays an averaged signal. However you can switch it to peak mode.
What do the audio envelopes look like? All these sounds have the same ADSR envelope settings, but use different VCA modes.
1) Linear Mode.
This is useful for controlling the level of LFO’s or other modulation sources.
However for audio use such as a VCA this doesn’t sound like a natural audio decay to the human ear, as it seems to become faster as the level decreases.
2) Exponential Mode:
This emulates the discharge rate of a capacitor (which is how an analogue ADSR works) and so is the closest reproduction of the audio envelope produced by an analogue synthesizer.
Given a volume from 0 – 10, this formula gives the output level in volts.
volts = 10 – c1 * (1 – e^( 3 * (volume / 10 – 1)))
Where ‘c1’ is a constant that determines the amount of curve:
c1 = 10 / ( 1 – e ^-3 )
c1 =10.524
3) Decibel (dB) Mode:
The human ear hears this as a constant, natural fade.
The Decibel curve drops by 35 dB between 10 – 1 Volt.
dB = (35/9) * ( volume – 1.f )
Volts = 10 * 10.f ^ ( dB * 0.5 )
Since a perfect dB curve can never reach zero volume in reality, the Synthedit VCA is designed so that below 1 Volt the VCA dB curve fades out to silence. This mode gives the most natural sounding VCA envelopes of all.
Converting Volts to dB
To convert a level in volts to dB, use the following formula:
dB = 20 × log10 (volts ÷ 10 )
To convert a level in dB to Volts, use the following formula:
volts = 10 × 10^ (dB ÷ 20)
Tremolo
Mix a slow sine wave with 8V DC from a Fixed Value(Volts) module (to make sure the whole sine wave stays above 0V), then feed this into the Volume Plug of your VCA. The audio signal will mostly come through to the output because of the DC bias, but you will hear the amplitude get louder and quieter in time with the sine wave you are using to modulate it.
This effect is called tremolo (Amplitude Modulation). In the screenshot below the Yellow waveform is the modulation sinewave and the green is our audio. You can see how the peaks and troughs in the audio level follow the modulating sinewave.
The slider control changes the level of the modulating sine wave, this works best with the maximum level set as 8V.
Note: For this effect to work correctly the response curve must be set as Linear.
Amplitude Modulation
Tremolo (shown above) uses a slow (say 3Hz for example) sinewave to modulate the amplitude of your audio signal, so you can actually hear the resulting loud/quiet cycles. If you increase the modulating frequency so that it gets up into the audio range, however, things start to get interesting.
The modulation has become so fast that you are now changing the shape of the original audio signal’s waveform, and new frequencies appear.
In the example below I have modulated a 7kHz sine wave with a 4kHz sine wave. As you can see in the Frequency analyser, not only do we have the 7kHz audio signal, but also two new frequencies have appeared at 3kHz and 11kHz. This is where the 4kHz signal has interacted with the 7kHz. Why 3 and 11 kHz? It’s because the frequencies are added and subtracted in the modulation process:
7kHz – 4kHz = 3kHz and 7kHz + 4kHz = 11kHz. This is similar to ring modulation, but there’s one key difference, with Amplitude Modulation the carrier frequency (the 7kHz signal) is still present at the output, whereas with a true balanced ring modulator only the new 3kHz and 11kHz frequencies would be present the 7kHz carrier having been suppressed.
Complex Amplitude modulation.
However it’s not always this simple to predict the results, if we modulate the 7kHz sine wave with a 4kHz sawtooth then the mathematics becomes more complex- we get many more frequencies added, (due to the more complex harmonic structure of the sawtooth)and would need to use Fourier analysis to predict the outcome.
This is where a number of other posts all “come together” to form a major project- a 16 step sequencer. Arguably one of the best known sequencers being the Moog 960 Sequencer module (see below).
What is a Sequencer?
Sequencers for synthesizers are typically constructed with analog electronics, and play the musical notes designated by a series of knobs, sliders or other selectors corresponding to each musical note (step).
An analogue sequencer is useful for both composition and live performance as the musician can change the musical notes at any time without having to re-enter a recording mode as would be needed with a many digital sequencers.
Another control option is that the time interval between each musical note (length of each step) can be independently adjustable. Typically, analog sequencers are used to generate the repeated minimalistic phrases which may be reminiscent of Tangerine Dream, Giorgio Moroder or trance music. The steps are not limited to controlling Pitch and note duration, we can also control the filter cutoff, note velocity, and many other parameters.
Can we produce the equivalent of an analogue sequencer using SynthEdit? As with many other synthesizer functions/modules the answer is with a bit of planning- yes we can, with as many “bells and whistles” as you feel you need.
Our Sequencer prefabs so far are:
The BPM Clock sets the tempo of our sequencer by synchronizing it with the host DAW, it could also have a free-run option that’s not locked to the host DAW.
The Step Counter takes the stream of clock pulses from the clock oscillator, counts them and outputs an Integer. We can make this count up, down or in pendulum mode. The number of steps in our count can also be controlled.
The Integer to Step converter this takes our Integer and outputs a Boolean message as each integer is output which is specific to that particular integer, which is then fed to
The Step Modules which contain the modules producing the voltages which will control the Synthesizer connected to our sequencer via a few other modules.
See the structure shown below:
In the output section we have two ED Glider modules, which introduce a Glide or Portamento to the transition between our two CV outputs for Filter (cutoff) and Pitch. The Glide Time slider has a maximum value of 0.1 set (You could alter this, but 0.1 is about the maximum Glide rate you’ll want). The glide timing method can be changed between Constant Rate and Constant Time.
There is a Level control in the Filter CV output so we can change how much the steps affect our VCF.
The Divide module is to reduce the Velocity output to a useful amount. I used a value of 2 on the Input 2 Plug.
The Monostable in the Gate Output is used to produce a short trigger pulse for triggering ADSRs and so on.
Controlling the Synthesizer parameters step by step.
So now we have all the building blocks (almost) for a basic sequencer, we need some means of getting it to control our synthesizer. This is where our next structure comes into play, the Step Prefab. The structure is shown below but there’s a couple of things I’ll elaborate on.
Gating the control voltages.
The input to the step prefab has a comparator. Why? Well we want to “gate” the control voltages we’re feeding to the synthesizer, otherwise they will all just add together at the output, not the idea of our sequencer.
The Comparator is set up so that when the Input A reaches 5 V the output will rise to 10V, anything below this and the output will be 0V. This is then fed to the Level Adj modules. When their Input 2 is at 0V there will be no voltage passed to the output, when the Input 2 switches to 10V the input signal will be passed through to the output. The Led 2 is added to show which of our 16 steps is active at any given time. Without the comparator the voltage reaching the Level Adj module will only be 5V, which will upset our tuning.
Setting the Pitch.
This is a slightly modified Detuner module the original is shown below, but (personally) having numbers for the notes doesn’t make it very “musician friendly”, plus we don’t really need the fine tune in this application.
As you can see here the fine tune control is removed, and we have the note names from the musical scale rather than numbers.
Important: Don’t edit the fixed vales for the notes, just the name properties for the switch and fixed value modules. Just delete the fine tune part of the prefab.
Control the Velocity.
Normally when we play a keyboard we get some variation in loudness, and often timbre dependent on how hard we play the keys. This is added in with a switch module and a set of Fixed Values (Volts). I used 0V, 2.5V, 5V, 7.5V and 10V to represent a useful set of velocity levels. No reason not to use a slider control for this… this is after all just to show how a sequencer can be assembled in SynthEdit.
Connecting the Steps up
I have only shown two steps to give you the idea (otherwise it’s just too complex with all 16 steps). The gate output connection is not used in this Sequencer.
This is a fairly basic structure consisting of 16 Roy IntTo(Bool) modules.
The IntTo(Bool) module is basically a comparator for Integers instead of Voltages.
Input (Integer): The input value to be compared.
Trigger At Value: The value that the input is to be compared with.
Invert (Boolean): If set to true the output will be “True” when the comparison is “False”, and “False when the comparison is “True”
Trigger Only If Equal: There is a very useful setting in the properties that we need for this structure: “Trigger Only If Equal” which means that if this box is ticked the output will only be “True” if the Input and “Trigger at Value” input match. If this is not ticked then the Output will be “True” when the Input Integer matches or exceeds the trigger value
The Integer to Boolean step converter.
These modules take an integer input from the DSP Count Input, and if the IntTo(Bool) module receives an Integer that matches the one specified at the Trigger At Value plug, then it will set the output to “True”.
If we set up a structure like the one below, and set up the Trigger At Value on each module then we need to start with the first module at Value 0, working up to 15 for the last module. All modules need to have their Trigger Only If Equal set as “True”. As the Input Integer value steadily rises/falls the appropriate module will send a true signal.
Note: the trigger value for the first module must be 0.
Now we have most of the building blocks for a functional sequencer…
This module will give you the option to count up, or down, count to a set number and stop, or a pendulum mode (count up from 1-16, then count down from 16 to 1 and so on). The number of steps in the sequence can also be set via a drop down list. At the heart of this structure is the ED DSP Counter. This module takes a train of input pulses and counts them, outputting the appropriate integer.
ED DSP Counter.
Counts the number of Boolean input impulses between 0 (included) and a specified value (positive, negative or zero to block counting) specified by the Integer at Max Plug (included).
Input (Boolean): Input pulses to be counted.
Reset: At any time a Boolean “True” sent to the Reset pin can reset the counter to zero allowing it to restart.
Mode (List): The count can proceed in several ways depending on the Mode setting:
1) Unlimited: positive if Max is >0, negative if Max <0, no count if Max = 0
2) Stop: the counter is stopped once the Max value is reached
3) Wrap: the counter is reset to zero after the Max value is reached
4)Ping-pong: (Pendulum) The count proceeds from zero to Max then back to zero, indefinitely.
Max (Integer): Sets the maximum count.
Output (Integer): Outputs the number of pulses counted as an integer.
By using this counter we have an effective way of making a step counter which can be fed by the BPM Clock4 oscillator. This allows us to have a count running from 0 through to 16 (or whatever maximum is set), in a variety of modes.
Controlling the count direction.
Going up… Going down.
The first point of note is that the vales in the Fixed Values (Int) module are a little counter intuitive, until you consider the way the DSP counter counts. They are listed below with the actual number of the steps on the Left (Name) and the corresponding integer value on the right (Value). Step 2 has the count value of 1? That’s right. It’s because we are counting from 0, but referring to 0 as step 1. The value is always one less than the step number.
These values are output to the Switch (Many>1) so we can select the number of steps we want in our count.
The Max count on the DSP counter is self explanatory, but we do need to look at how the ED Subtract module is connected (Below).
Input 1 must be fed from the switched Integer values, and Input 2 must be fed by the DSP Counter, otherwise the up/down count values just won’t match up properly. The Switch (Many>1) allows us to switch between counting up 1->16 and down 16->1. So (ignore the blue line and plugs) out Integer count is fed to the IO Module to go to our next structure/module.
Having a clock oscillator which can be controlled by the DAW it’s VST is hosted by is very useful for sequencers. We can set up a clock oscillator that is synchronized to the BPM setting of the host DAW, and is stopped and started by the DAW using the Transport Run buttons. We need two special modules for this:
The BPM Tempo Module, and the BPM Clock4 Module.
Important Notes: Neither the BPM Tempo or BPM Clock4 are fully functional until they are in a VST in the Host DAW>
1) Whilst in Synthedit the BPM Tempo will not produce an output from the Transport Run plug, and the Tempo out will always read 120.
2) Whilst in Synthedit the BPM Clock4 will always run at 120 BPM regardless of any other settings. Only the Rate plug is functional.
The BPM Tempo Module.
There’s no settings to apply to this module. It has three output plugs:
Tempo Out (Voltage): The Tempo Out plug outputs a voltage that is directly proportional to the BPM tempo which is in use in the host DAW
Transport Run (Voltage): Outputs 10 Volts when the DAW’s “Run” button is pressed. This can be used to start or gate an oscillator.
Processor resumed (Boolean):
The BPM Clock4
This module is a clock oscillator which automatically synchronizes to the host DAW’s BPM setting. The clock output is synchronized to the DAW’s time grid, with a list of pre-set division rates.
There are three input plugs:
Rate (List): Allows the user to select from a list of divisors.
Swing (Floating Point): Controls the “swing” of the oscillator.
Pulse Width (Floating Point): Adjusts the width of the output pulse from the clock oscillator
Swing- what is it?
Swing in music often refers to a specific rhythm and notation convention, whereby the first beat is twice as long as the second, then the third beat is the same length as the first, and so on. It’s effectively a variation on triplets or 6/8 timing, often written in common time (4/4) for simplicity’s sake, with the swing timing added by the musicians. The timing itself gave its name to swing music, the 1930s offshoot of jazz based on those same lopsided rhythms. Swing eventually came to be used to describe any rhythm with a slightly off centre groove. Drummers ‘swing’ the beat to add a groove, introducing a slightly irregular feel to the timing of the rhythm. Don’t confuse swing with sloppy, or poor timing – we’re not talking about inaccuracy here. Instead, it’s about the deliberate, subtle timing variations around and on the beat, which musicians introduce to the music.
The term mainly refers to drumming simply because drummers set the whole groove of any group and generally play repetitive rhythmic patterns, but swing can also be applied to the timing of any other instrument.
To find out more have a look at this article: https://www.attackmagazine.com/technique/passing-notes/daw-drum-machine-swing/
Putting the Clock Oscillator together.
By combining these two modules we have a clock oscillator which is synchronized to the DAW’s timing grid, and is stopped and started by the DAW’s “Run” button.
All that needed is shown below.
The Transport Run plug is connected to the Input 2 of the Level Adj module to use it a gate for the clock pulses.
The Swing and Pulse Width sliders are connected via Volts to Float converters to ensure smooth operation of the controls. We can leave these converters on their default settings of Volts DC (Fast) for the Response, and 10Hz for the update rate.
The Tempo out plugs and its associated modules are there to provide a readout of the DAW’s BPM setting on the VST’s control panel (Optional).
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
Frequency dividers are useful for emulating hardware electronic organs, or string synthesizers that utilized the same approach for generating their sounds. There are two approaches that can be used here:
The first one uses a stock module, the Binary Counter 2, and the second method uses a third party module from Elena Designs, the ED DSP Timer. Both these methods work well in the audio frequency range as well as the lower frequency ranges used for sequencer clocks etc.
Note: When used as an audio frequency divider for String Synthesizers etc, the only audio waveform available is a square wave, because we are dealing with binary (on/off) operations no matter what waveform you feed into the DSP Timer or Binary Counter the output will always be a square wave.
Using the Binary Counter 2 as a Frequency Divider.
All that’s needed is to feed the input frequency (F) into the Clock plug, and take the relevant outputs from the Counter
Note: B0 = F/2, B1 = F/3 and so on.
Using the ED DSP Timer as a frequency divider.
It’s quite simple to set this up as a frequency divider. All that’s needed is to set the Mode to “Bistable” in the properties, and it will divide the input frequency by two. There’s no need to worry about the T1 and T2 plugs as they are unused in this mode, just feed the Audio (or clock) signal into the Trigger plug, and the Output will be a square wave at half the input frequency.
By chaining the timers we can get F/2, F/4, F/8, F/16 and so on.