Stuck with a SynthEdit project?

Author: Stephen (Page 1 of 17)

Using Waveshapers.

In electronic music, waveshaping is a type of distortion synthesis in which complex spectra are produced from simple tones by altering the shape of the waveforms.

Uses

Waveshapers are used mainly by electronic musicians to achieve an extra-abrasive sound. This effect is most used to enhance the sound of a music synthesizer by altering the waveform.
The simplest form of Waveshaper could be considered to be the Rock guitarist’s faithful effects pedal, the “Fuzz box”. Some synthesizers or virtual software instruments have built-in Waveshapers. The effect can range from subtle “warmer” sounds through added harmonics, overdriven “Fuzz” sounds, and metallic inharmonic sounds. The end result can bear no resemblance to the original sound fed into the shaper

How it works

A waveshaper is an audio effect that changes an audio signal by mapping an input signal to the output signal by applying a fixed mathematical function, called the shaping function. The Harmonic or Inharmonic content of the signal is entirely dependent of the shaping function. In SynthEdit we can’t control any of the parameters by voltage control, it’s all done by a fixed formula supplied as a text string.
Consider the diagram below.
In the top example, we have a function where the output is identical to the input. This is due to the fact that our function x results in -1=-1 and +1 =+1, so the transfer is not altering the signal.
In the bottom example our function of -x results in -1=+1 and +1=-1 so we have inverted the sine wave input. There will be no noticeable harmonic change, just a polarity inversion.

Changing the formula from x to -x

Soft clipping example using 5*tanh(x)

Our next example below is entirely different. As you can see changing the transfer “curve” results in an entirely different output. Here we have used the function of 5*tanh(x), which “soft” clips the sine wave input.
There is one important point to note here when using the waveshaper: that is that it has a maximum input of +/- 5 volts if we exceed this it will clip the input regardless of what formula you are using.

By changing our formula from 5*tanh(x), to 5*tanh(x/2), we don’t affect the level of the signal, but we do soften the clipping effect even more. (Try 5*tanh(x*2) if you want slightly harsher clipping.

In general the steeper the transfer curve the more harmonics you will generate.

Note: All the examples shown below have a pure sine wave input.

5*tanh(x)

Formula: 5*sin(x+2/PI)

5*sin(x+2/PI)

Formula: 5*sin(x+10/PI)

5*sin(x+10/PI)

Formula: 5*sin((x+2/PI)*(x+2/PI))

5*sin((x+2/PI)*(x+2/PI))

Formula: 4* sin((x+2/PI)(x+6/PI)/(x+6/PI)(x+2/PI)+(x+2/PI))

4* sin((x+2/PI)(x+6/PI)/(x+6/PI)(x+2/PI)+(x+2/PI))

Formula: 6* cos((x+2/PI)+sin(x+2/PI))

6* cos((x+2/PI)+sin(x+2/PI))

Formula: 3 * (abs(-abs(-abs(x+1.25)+2.5)+2.5)-1.25)

3 * (abs(-abs(-abs(x+1.25)+2.5)+2.5)-1.25)

Formula: 4 * sin (abs(-abs(-abs(x+4.25)+6.5)+4.5)-4.25)

4 * sin (abs(-abs(-abs(x+4.25)+6.5)+4.5)-4.25)

Formula: tanh((x/PI)(x/PI)(x/PI)(x/PI)(x/PI))5* sin((x/PI)(x/PI)(x/PI)*(x/PI))

tanh((x/PI)(x/PI)(x/PI)(x/PI)(x/PI))5* sin((x/PI)(x/PI)(x/PI)*(x/PI))

As you can see there are some quite interesting effects to be had from a waveshaper. Experimentation (and a some mathematical knowledge) is the key to getting usable results.

Note about Input voltages:
You really need to keep both the input voltage under control, and the curve in the waveshaper screen.
Once the input goes outside +/- 5V you will get digital clipping, and aliasing.
If the input is going outside this range use a level adjust module.

Important note:
When putting you formula together be sure to use brackets, and make sure you close them when needed- one missed bracket will destroy your carefully crafted formula.

Note about formulae, and keeping the voltages under control:

You need to keep the output from the waveshaper under control to avoid clipping in modules further down the chain. Once again it will be digital clipping, and that’s not pleasant. To demonstrate if we use the formula
tanh((x/PI)(x/PI)(x/PI)(x/PI)(x/PI))5* sin((x/PI)(x/PI)(x/PI)*(x/PI)) and alter it to
3 * tanh((x/PI)(x/PI)(x/PI)(x/PI)(x/PI))5 sin((x/PI)(x/PI)(x/PI)*(x/PI)) the whole thing starts to go badly astray…

3 * tanh((x/PI)(x/PI)(x/PI)(x/PI)(x/PI))5* sin((x/PI)(x/PI)(x/PI)*(x/PI))

You can see that the curve on the module is going well outside the limits, and that the output is well over +/- 10 V, so any modules after this will be overloaded.
If this does happen then just modify the formula values, or if that doesn’t help you can do the following:
tanh((x/PI)(x/PI)(x/PI)(x/PI)(x/PI))5* sin((x/PI)(x/PI)(x/PI)*(x/PI))/2

tanh((x/PI)(x/PI)(x/PI)(x/PI)(x/PI))5* sin((x/PI)(x/PI)(x/PI)*(x/PI))/2.

Adding the /2 at the end of the formula has reduced the level by half.
To sum up:
If the output is too low multiply the whole formula by a suitable number, if it’s too high divide the whole formula by a suitable number.
A good investment if you want to get serious about devising your own formulae would be a set of Trigonometry tables, Log and Exponential tables, a good scientific calculator. A book on mathematics and Trigonometry would give a few insights too.
Wildly devising a formula without any planning and “hoping for the best” really won’t work (except by pure luck).

Linear to Log/Exp conversion for LFO & ADSR.

Converting an LFO Waveform.

This circuit converts a normal Ramp/Sawtooth input with the default range of +/-5Volts, to an exponential Ramp/Sawtooth. Any offset or gain voltages are shown on the fixed value modules. This module works well with an LFO but as it stands is not suitable for use with an ADSR as it works in the -5 to + 5 V range , and not the 0 to 10V range of an ADSR.

Shown below are examples of the output waveforms. It is useful with Sine, Saw, Ramp and Triangle waveforms but not Pulse. I have used offset voltage rather than a DC blocker HP Filter on the output to make the voltages symmetrical about the 0 Volt (Y) axis, as the High Pass filter would affect the waveshape changing our LFO output once again.
Important Note: Any gain control MUST be placed preceding this module so as not to change the symmetry of the waveform around the 0 Volts axis.

Exponential Saw
Exponential Triangle, Inverted exponential Triangle, linear triangle
Inverted exponential saw, Exponential saw, linear saw,

Converting an ADSR Envelope.

This is slightly more complicated as we are dealing with the range of 0 to 10 Volts so we need to do some clipping to make sure the lowest output voltage is 0 Volts and to increase the output of the ED Log so we get the full 10 V range.
For this reason the Overall Level plug on the ADSR 2 module must be fixed at 10. The gain adjustment is made at the output of the prefab so we can go between -10 for inverted envelope and +10 for full normal envelope. Generating the exponential envelope just needs a Level Adjust module with the envelope feeding into both inputs.
Note: The sustain levels will be different between Linear, Exponential and Log shaping – as yet I haven’t found a way to avoid this issue. Blame the laws of mathematics!

SynthEdit Tips, traps and Tricks.

TIP: Using the Zoom in function: (V1.5 only)

In both the structure and panel view, you can zoom in and out of the view by holding down the CTRL key and using the mouse wheel. Amongst other things it can make it much easier to select the nodes on the cables between data plugs.
Even that pest of a node “hidden” under a cable can be selected and moved when zoomed in. Last but by no means least you can see complex wiring better.

TRAP: GUI modules need to be seen

Sub Controls function only while their Container’s Panel is open.  i.e. if you close you synth’s panel, those sub controls become inactive.  Therefore never rely on GUI modules to process audio signals.  The exception is hybrid modules (Patch Memory) which continue to provide patch-selection and automation functions via their audio pins.

TRAP: Avoid splitters

Due to a design mistake, SynthEdit 1.0 had the Container’s “Control on Parent’ pin on the wrong side.  This made it impossible to connect it to a Patch Mem module (needed for save/recall of paged panel settings).
The “‘Bool Splitter” was introduced to fix this problem, but the bool splitter causes bigger problems of it’s own.  The bool splitter “reflects” any input signal back out it’s other inputs, this is a bad design because it is not clear which module is in control of the others!  The result is modules ‘fighting’ each other for control. Symptoms include odd and inconsistent behavior, along with patches not saved and/or recalled correctly.
Note: Some third party module developers have in the past copied SynthEdit’s example and released modules that rely on the use of splitters. 
This is not their fault, however if at all possible avoid using splitters.

TRAP: Connecting Patch Memory to Patch Memory.

Do NOT do this, it will cause data and Preset conflicts. If there are other modules in between the two Patch Memories that’s fine, but a direct connection is a complete non-starter.

TRAP: Don’t connect the Polyphony module to a Patch Memory.

The Polyphony module is a type of Patch Memory module. Connecting a Patch Memory to a Polyphony Module will cause huge problems with Data conflicts. However much you think it might be useful DO NOT DO THIS.

TRAP: Don’t use audio modules to process GUI signals.

You should always aim to minimize your use of hybrid modules.
For example: Suppose you want to increase a knob’s display to a range between 0 and 100 (without actually altering the output value, your might think it’s an idea to use the standard DSP Multiplier module. Being an Audio module, this requires an extra conversion via a patch-mem or similar module.  It’s far better to use a ‘pure’ GUI solution like the Float-Scaler module.  This will keep your circuits far simpler and your CPU usage much lower.

The WRONG method of doing the Math conversion:
Never do this, it’s wasteful of resources, needlessly complicated and uses far more modules than you need (and can introduce Float conversion errors).

The correct method:
This is much simpler, doesn’t use needless GUI -> DSP -> GUI conversion, and uses far fewer resources. It’s also (I think you’ll agree) much less complicated.

TRAP: Don’t use GUI modules to process Audio (DSP) signals.

There are some very good reasons for this:
1) GUI modules use a different CPU “thread”, and run at a slower rate than their DSP counterparts to save on CPU usage. This will cause audio dropouts and errors of all sorts.
2) It’s very inefficient and wastes CPU resources.
3) A GUI module in a container will not pass audio if the container is not open when the VST is in use- your VST won’t work properly.
The only GUI modules that can be used with DSP are the Patch Memory modules- they are designed to work reliably.

TRAP: Don’t make structure changes when the Audio Engine is running.

It’s a known problem that making changes to the wiring, adding certain modules or replacing modules when the Audio Engine is running can cause crashes. Either SE will completely freeze, or will just shut down with no warning.
There is no autosave!

TRAP: Windows Default Fonts.

When using fonts in SynthEdit make sure you use the windows system fonts. However much you’re tempted by a fancy LCD or 7 Segment style, or a futuristic looking font- do not use it unless you are rendering it as a graphic file. If the end user doesn’t the same font on their system at best you will get a substituted font that looks vaguely like your original, or is totally different in style and size.
Safe fonts for Windows are listed on this web page
Safe fonts for MAC are listed on this web page

Crashing: SynthEdit V1.5 keeps crashing for no apparent reason.

If you have persistent problems with SynthEdit crashing, make sure you have the latest build (check here for the latest update)
Open the Edit->Preferences option and select the General tab. Make sure that the options Disable Hardware Graphics, and Disable Deep Colour Swapchain are selected. This stops SynthEdit from using dedicated GPU memory, and reduces the memory usage by the graphics. This can solve the problem in quite a few cases where low-end GPU cards are in use. There are known issues with some Intel GPU’s and their drivers causing problems with SynthEdit.
Also it can help to include an Sound Out module in every project if you’re going to turn the Audio Engine on.
ASIO Drivers.
If you have a soundcard that supports ASIO, it’s best to used a dedicated ASIO driver supplied by the OEM. ASIO4All is not recommended as it’s just a generic driver, not soundcard specific.
This is not a confirmed problem but I have personally had issues with the Behringer Soundcard ASIO drivers causing SynthEdit to crash with no error logging.

TIP: Saving CPU – cut down on un-needed modules.

The structure below might seem a good way so have a volume control in your Synthesizer. Up to a point it is, but there’s a much simpler way of doing it.

The wrong way of controlling the volume.
Because both VCA modules process audio data at the currently set sample rate, usually 44khz, SynthEdit now has to perform an extra 44,100 calculations per second!

The method below however uses one module less. Any module that generates or processes audio signals will use more CPU than a module that doesn’t.

Signals originating from sliders, knobs, and any other data that doesn’t change very often, like the MIDI to CV modules Pitch and Velocity outputs, the output signals of controls can be considered control signals which use less CPU power.
They are only really using power when you change a control position.

An envelope generator module is somewhere in-between DSP and GUI in it’s mode of operation; during its Attack and Decay segments, it’s generating audio rate data, during the sustain section of the envelope, it’s generating a flat-line, control-rate signal.
1) Adding modules to the control path is often cheap or even free. However this does not mean use GUI modules to do the work of DSP modules.
2) Adding modules to the audio path is expensive in terms of CPU usage.

One less VCA module
Cutting down on the number of modules.

The correct method of controlling the volume is to use the Overall Level plug on the ADSR2 module. But you say, I want to use the output of the ADSR to sweep the cutoff of the filter. Well most Synthesizers have a dedicated ADSR for the VCA, and another for the filter or any other modules that deed an envelope modulation, and that one can be controlled in the same way.
Each patch cord that routes audio signals in SynthEdit represents an audio buffer of around 100 samples (that’s 400 bytes of memory), so this final version not only saves 44,100 math calculations every second; it’s also saving a further 88,200 sample copies per second by using less patch cords.

Keep those structures simple.

Remember: Each DSP module, and each DSP patch cable is eating up CPU cycles!
Always look for a way to use fewer modules and patch cables.
Always think K.I.S.S: – Keep It Simple Sir.

TIP: Downloaded Third Party modules don’t show in the browser.

This is not a bug, this is due to the way windows treats files containing executable code that have been downloaded from the Internet. In some cases windows deems them a security risk, and blocks them from being scanned by SynthEdit. Right click on the module in question and you’ll see a properties option, click on this and this window will pop up:

To allow SynthEdit to scan the file check the Unblock box, and re-scan the files.

Making the switch Prefab more versatile.

What can be added to the switch?

The stock Switch Module in SynthEdit is OK, but could it be more versatile?
Well yes, we can add more outputs. A switch with a volts output is good as far as it goes, but how about including the obvious Bool output? But then maybe a Float output, a GUI Float output, and a Bool Float output? While we are at it how about an LED On/Off lamp, and Text that changes between the On and Off states?
It’s all quite simple to do using the modules shown below:

Swapping the On/Off text labels.

If you think the RD Text Entry modules look different-it’s because they are containerized so we can hide and show the text labels as required. This is done by switching the Visible Plug from true to false using the RH Logic Gate NOR wired as a Bool inverter fed from the Animation Position via a Float To Bool converter.
Note: You can only perform this “trick” using containers.

Converting the LED to Animation Position.

Using the standard LED control would mean using an extra module to Convert Float To Volts from the Volts Out plug on the Patch Memory, so by taking out the Volts To Float converter and the Patch Memory from the LED we can connect it up directly to our existing Patch Memory in the Switch module. Leave the LED containerized as it keeps the Image2 and The Tinted Bitmap Image aligned when you move it.

And below is the final layout. You can set the On and Off text to suit the use of the switch, and the Text colours to suit your colour scheme, withe the text background transparent, or whatever your choice is. Just make sure you get the text carefully aligned in the panel view so it doesn’t “jump”. Tip: while you’re lining the text up disconnect the Input to the RH Logic gate- then both text labels will be visible, and can be aligned easily.

Creating your own slider

Creating a slider control, and making it your own is quite a simple process.
In the example below I have created a slider control that operates more or less like the stock slider.
The difference is that by the addition of the two ED Text Entry modules, and a Float to Text module we can make the readout and label for the slider more versatile.
Using the FG ARGB (Text) and BG ARGB (Background) we can change the text and background colours, and even make the background transparent.
The Decimal Places plug controls how many 0’s appear after the decimal point.
-1 gives us a default of 2 DP’s, 0 the obvious 0 DP’s and then with positive integers 2,3,4 DP’s etc.
Make sure that you set the Enabled Plugs on the Label Text Entry module to False, and the Alpha Disabled to 1 to prevent users clicking on the text and editing it.
whether you set the Value Text Entry module to Enabled or Disable depends on whether you prefer not to have the control value editable by clicking on it.

Below is the finished control prefab with both Float and Volts output.
The ARGB values, label, and decimal points can all be set without opening the prefab.

Now is where this control comes into its own. You want to re-arrange the layout so the title of the control is above or to one side? -simply edit the panel view. You want to convert the volts readout to another format? just add some more modules. You wanted red text on a grey text box? again no problem just change the ARGB values.

Adding 1V/Octave to Hz conversion for the value.

How many times have you wished that the slider could be made to display the frequency in Hz of a filter or oscillator that’s scaled in 1V/Octave?
This just requires a modification to the display of the slider value. We want to convert from Volts to Hz, then append Hz to the value.
Fortunately Elena Novaretti has once again made the job easier with some handy modules: ED Oct2Hz, ED GUI String Append, and the ED Fixed_String modules.
Just remember when you’re entering Hz into the Fixed String value to put a space before the Hz so there’s a space between the value and the Hz.
Notice that as well as the DSP Float and Volts output, I have now added a GUI Float output as well.

Want to display in kHz? No problem.

Simply add the ED GUI Divide (Float) module, set the value of Input 2 to 1000, and change the fixed text string to read kHz.

ADSR Time readout for the Slider.

Yes, there is a way of doing this in the old Wizzoo book by David Haupt, but this would involve converting from GUI Float to DSP Float, and then back to GUI float again which would be very wasteful of CPU resources.
Instead we can use a Float Function in the Float to Text conversion process by entering the formula of 10^(Volts*0.4-3) into the Float Function’s Formula: A = Plug properties, and just enter A into the Formula B: = Plug properties
(we aren’t using the B to A direction, only A to B), but something must be in the Formula: B= section for the module to work.
We can use this slider for the Attack, Decay and Release sliders.

ADSR Time readout
Modifying the slider to give a time readout for use with the ADSR2 module.

Improving CPU usage with Delay 2

What is the CPU usage issue with Delay2?

Consider the structure below, with the settings we have on the controls, there could potentially be a very long “tail” on the echo with such a feedback level. Ok so it reaches a low level, but it could take a very long time to reach what SynthEdit considers “silence”. Why does this matter?
Well any modules further downstream are not getting shut down as they should be, and could still be active long after the human ear would fail to detect sound from the echo. This is a waste of CPU, as these modules are relying on SE telling them that they are not receiving audio, meaning they may not go into “sleep” mode for a long time. There is no risk of generating “Denormal” numbers as SE removes these internally.

Here is a quote from a regular contributor on the SE group Andrew Ainsley:
“I sleep my modules when it is approximately under -110dBFS(noise floor of the best high-end AD converters, and humanly detectable dynamic range is approximately 120dB), and I’m assuming Delay2 sleeps at somewhere just before denormal mode, which is very very low, I tested up until -250dB and Delay2 is still active for quite some time afterwards…In practice say, with a max delay of 1 sec and 50% feedback, Delay2 will take in the order of minutes to go to sleep, which in practice is longer than a typical song, which seems rather pessimistic to me – i.e. in practice it will never sleep even though it can sleep, and thus it also keeps downstream modules awake while processing an inaudible signal. Switching it off sooner (in level) might cause audible clicks, but even if you assume the end-user will boost the level by an unrealistic value of say +120dB(!), you should still be safely able to switch off at about -230dBFS. “

If we look at the chart below you can see what is meant by the tail, the red section is where the reverb/echo is tailing off (The purple section). At high feedback levels this tail can potentially become very long if there is no cut off point set other than 0, even though we can’t hear the sound. We want to keep the green and blue sections, but it would be very handy to be able to remove the inaudible section of the tail.

Reverb/Echo tail illustration

How can we stop this waste of CPU?

Fortunately Jeff has introduced a new module in SynthEdit to prevent this issue-the Silence Gate. This module does not wait for complete silence (0), but shuts off the audio at a level where we can’t actually perceive the sound. (Jeff has not quoted a level for this, just that it is completely inaudible.

Modifying the Detuner Prefab.

With a little bit of modification we can produce a Detuner Prefab that looks a little more “Moog” like in appearance, but still retains the ease of tuning obtained with preset steps. All we need is a Quantizer module, and a means of converting DSP Volts to a GUI text readout. The structure is shown below. There are a few value settings to take note of, but other than that no great surprises. I’ll take it section by section for the settings.

The Semitone Knob.

For this control as it covers a range of 1 octave we set the Knob so it has a maximum of 1 volt. The value is then fed into the Quantizer module which is set to steps of 0.08333 volts (0.8333 V = 1 Semitone). We then feed this into a divider with the Input 2 plug set to 0.08333, to a QTNVolts2GUIFloat converter, from there to a Float to Text converter (set the Decimal Places plug to 0) and finally to our ED Text module to display the Semitone number.

The Octave Knob.

For this control as it covers a range of +/- 3 octaves we set the Knob so it has a minimum of -3 volts and a maximum of 3 volts. The value is then fed into the Quantizer module which is set to steps of 1 volt (1 Volt per Octave). No divider is needed for this control, to a QTN Volt2GUIFloat converter, then to a
Patch Memory Float Out3, from there to a Float to Text converter (set the Decimal Places plug to 0) and finally to our ED Text module to display the Octave number.

The Fine Tune Knob.

For this control as it covers a range of +/- 1 Semitone (Yes the original is just up one semitone but I feel +/- 1 semitone is far more useful. we set the Knob so it has a minimum of -0.08333 volts and a maximum of of 0.08333 volts. The Quantizer module is not needed as we want continuous fine tuning, not steps. We then feed this into a divider with the Input 2 plug set to 0.08333, to a QTN Volts2GUIFloat converter, from there to a Float to Text converter (set the Decimal Places plug to 3) and finally to our ED Text module to display the fine tuning.

The end result:

Improving the Semitone readout.

Maybe you’re like me and have to work out which note corresponds to which number. There’s a way to get round this.
First you need to make sure the Knob has a Maximum value of 1 and not the default maximum of 10.
We convert the output of the quantizer to a GUI floating point value the same as the original knob, then the Float value is converted to Integer to feed to the Choice Plug on the Switch<Text module. This module is used to switch between the GUI Fixed String modules to display the note names in a text entry module.

The final layout using the notes option rather than semitone number.

Plugs on the Prefab “Module”

Visible: Set this one to “True”.
Label: The text label you want to have under the control.
Text ARGB: The colour of the text label and value in ARGB format.
BG ARGB: The background colour for the text label and value.
Write Label: Only set this to true when you want to change the label text.
Black/White Scale: Sets the scale around the control to black or white.
Decimal Places: Only really needed on the Fine Tune control. Otherwise leave the value set at 0.

Adding extras to echo.

Adding damping to the echo.

The first addition to echo which goes a long way to creating a more natural sounding effect is damping. What exactly is damping?
When we hear echoes in a large room, hall or any large space, especially if there is an audience or any form of furnishing, is that the higher frequency sounds tend to get absorbed, and reduced in level. We can emulate this easily with a 1 pole LPF, the frequency of this can be varied creating a variable amount of damping. We just need to set up a feedback loop with a Feedback – Volts module, our 1 pole LPF, and a Level Adjust module.

Adding a low pass filter to introduce damping to the feedback

It’s not “All about the Bass”.

Sometimes (well quite often) we don’t want too much bass entering an echo as it can make the sound “muddy” and even overpower the higher frequencies. Adding a simple 1 pole HPF on the input of the Delay 2 module can help greatly with this by cutting out those troublesome lower frequencies

Adding high pass filtering to the delay

Getting a “Tape Echo” sound.

What is Tape Saturation?
It’s a subtle effect that occurs as the magnetic particles in a recording tape (remember reel to reel recorders?) are asked to record too higher signal level it introduces a slight harmonic distortion, and a soft clipping effect. What some would refer to as a “warm analogue sound”. Used sparingly it can add to an effect such as echo to reproduce some of the old tape delay effects units.
Examples of these were Roland Space Echo, Korg Stage Echo, and the famous Watkins WEM “Copycat”.
The distortion in these machines was a result of several factors:
The design of the amplifiers
The amount of tape “bias”
The type of recording and playback heads
The type of tape
The amount of feedback used.

Getting the “saturated tape” effect.
This can be done by adding a subtle distortion using the TanH formula. I have used a Waveshaper 2, for a tape effect it only needs to be a subtle amount, and nothing too harsh, so TanH is the ideal formula for imitating a soft tape saturation effect. An example of a TanH curve is shown below (full formula 5*tanh(x) along with the effect on a sine wave (yellow is direct from the oscillator).

5*tanh(x)
5*tanh(x)

We can soften the effect more by a simple modification of the formula to 5*tanh(x/2)

5*tanh(x/2) shaping
5*tanh(x/2)

Or the distortion can be increased by changing to 5*tanh(x*2)

5*tanh(x*2) shaping
5*tanh(x*2)

The depth and harshness of distortion is directly related to the multiplier or divisor vale for x. The greater the divisor the softer the effect, the greater the multiplier the harsher the effect. My suggestion would be to use a formula along the lines of 5*tanh(x/3), or for an even more subtle effect 5*(tanh/4)

5*tanh(x/3) shaping
5*tanh(x/3)

The Finished “Tape Echo”

Here is the final version. I tested a few modules for the saturation effect, and found the best sounding one seemed to be the stock waveshaper 2 using the formula tanh*(x/4).
The X Mix module on the waveshaper output is to give control over how much of the distorted and undistorted sound is used in the feedback loop.
Note: Don’t forget to set the feedback level on the Delay 2 module to 0, as we are using an external feedback loop.
Creating a stereo Echo is as simple as duplicating the effect and using the same controls for both channels. I containerized the Waveshaper 2,and left it as a non-visible module so that it’s not shown on the panel layout, and therefore not available to the used to change the saturation formula in the waveshaper.

ED Shape Envelope in action.

Here is a simple Synthesizer using the ED Shape Envelope 5, and The Shape Envelope Editor for controlling the VCF and VCA modulation. I have deliberately left out any “bells and whistles”, as this is really all about how to put together a useable Envelope generator, and include it within a Synthesizer. Below is the complete layout. Just a single VCO, VCF and VCA- all standard modules. The “special” section is the envelope generator.

Next comes a closer look at just the Envelope generator structure. One point of note is that we only use the Gate and Pitch output from the MIDI to CV 2 module.
The ED Shape Envelope 5 module does not need a trigger pulse as the standard ADSR does.

The Shape Envelope generator.

This relies on three dedicated modules:
ED Shape Editor 6
ED Node Selector
ED Shape Envelope 5.
We have already looked at the Shape Editor and Shape Envelope, but not the Node Selector…

Node Selector module

The module automates selection of a required shape node using a List Entry 4. The selected node index will be output to the Node Index integer pin, which is connected to a Patch Memory Int for connection to the Shape Envelope 6 which accepts a node index.
The module internally reads the number of nodes in the Shape BLOB, and creates the correct enumerated list to be output to the List Entry module.
A valid shape must be provided to the Shape In BLOB plug for the module to work.
The First Node and Last Node “plugs” are found in the properties panel, and control whether the first and the last node will be listed or not in the drop down list having the first and last nodes hidden will prevent the user setting these nodes to non-zero values which will cause clicks.
A List Entry or comparable module needs to be connected to the right hand Choice and Item List plugs. The List value chosen will then be directly sent to the Node Index pin.
A value received on the Node Index pin will be translated to a corresponding choice number for the Choice plug, if feasible, or otherwise.
Note: Every time a new Shape is received or an unexposed bool option is changed, all outputs are automatically updated.
The Item is always available and corresponds to no node selection (-1)

In this structure we are using the Active Node to set the Sustain point in the Envelope. The Sustain node works much like sustain in a conventional ADSR module.

Interpolation Note: The Interpolation method is selected using the Patch Memory List module, which reads the options available in the Shape Envelope module, and makes them available to the Shape Editor. The Patch Memory method should be used in all structures with these modules as it prevents the attempted selection of modes that are not relevant, or unavailable.
In this application we have Linear, Curve 1 and Curve 2 modes.
Envelope duration and Sustain: This controls the length of the Envelope in mS. This duration is always added to the sustain portion of the envelope. If the option <No Node> is selected the Sustain mode is inactive and the envelope duration is always equal to the length selected by the duration slider regardless of how long the key(s) are held down.
Flip X: This flips the shape on it’s X (vertical) axis.
Reset: Resets the envelope to whatever is set on the Reset Value plug.
Note: You could include a Flip Y button, there’s nothing to stop you, but bear in mind that any non zero start and end node values will result in loud clicks.

The Env Duration slider.
You won’t find this as a standard SE slider control. This one outputs a Float value instead of Volts.
This is a simple little Prefab (courtesy of Elena) as shown below, it can be found in her Convenient Prefabs folder along with with the Modules folder

Adding Velocity control to The Attack and Decay times.

Adding this means that the harder the keys are depressed on the Keyboard, the shorter the Attack and Release times will be. This is quite simple and needs the following controls.
There are a few important points to take note of however:
Note 1: When no Sustain node is specified, the whole envelope is considered an Attack stage and the Release Vel Scal value is ignored. This is especially useful with some sounds like violins, to easily control the attack and release time with your keyboard’s note-on and note-off velocity, for realistic performance.
Note 2: to properly scale the Release stage, your MIDI controller must transmit a valid Note-Off Velocity value (cheap controllers usually set Note-Off Velocity to zero or to a bogus value; therefore, it is always better to leave this as an option).

ED Shape Envelope 5

Note: This is a complex subject, so please, please read carefully. You will be rewarded with a very versatile Envelope generator module. It’s essential with this module and it’s other associated modules to understand the operation before attempting to use it. This will save a lot of frustration and hassle!
This post will just cover the use of the Shape Editor, and modules used with it:
1) Shape Envelope 5 module.
2) Shape Editor 6 module.

Shape Envelope 5 Help file (edited)

Overview.
1) This is a Multi-purpose Shape-based envelope generator with an optional sustain point setting for versatility.
2) Optional Attack / Release time scaling and Amplitude scaling by keyboard Velocity are also supported.
3) The module can work as both an envelope generator, or alternatively a generic signed pulse generator.
4) A valid Shape must be supplied to the Shape input pin using the appropriate modules.

Operation of the module.
Every time the Gate is turned on, an envelope of the specified shape, interpolation mode and duration in milliseconds (minimum time allowed = 1 mS) is generated and reproduced until a node specified with the Sustain Node parameter is reached, if any Sustain Node is set (Attack/Decay stage); then the Sustain Node level is held at the output (Sustain stage) until the Gate pin turns off, then reproduction of the shape is resumed from the remaining part of the envelope shape until its natural end (Release stage).
When no sustain node is specified, the envelope generator works in “one-shot” mode.

Shape Envelope Module

Signed and Unsigned modes.

The default mode (Unsigned) for the envelope generator produces an unsigned signal ranging from 0 to +10 Volts, suitable for use with a VCA as an amplitude envelope.
However, for usage as pitch envelope, filter envelope, pulse generator (or any other purposes you can think of), the Signed option can be enabled in the modules properties, so that a signed envelope (ranging from -10 to +10 Volts) is produced.
Note: For visual consistency, it is advisable to set the Baseline to -5 in the Shape Editor when working in unsigned mode, or 0 Signed mode.

Start and End levels.

You are free to specify a non-zero level for both the first and the last shape nodes, despite the fact that this will naturally lead to discontinuities in operation, or audible clicks, depending on the application.
Keep in mind that the level of the last node will be held at the output as a static voltage when the envelope is over, for logical consistency (i.e. the output will not be forced to return to zero !)
Whenever the first and the last node is required to remain fixed at zero or to another level, you should fix their position with “Lock First/Last nodes” option in the Shape Editor, to prevent editing.

Sustain Node.

If the specified Sustain Node index is negative or larger than the number of current shape nodes minus one (the last node is not allowed because it would be pointless), there will be NO Sustain stage and a “one-shot” envelope will be produced.

Re-Triggering

Re-triggering refers to triggering the envelope generator before it has come to the natural end of the envelope.
When this module is used in a polyphonic circuit, the envelope can either be fully retriggered (position reset to zero) or resumed from the first point whose level is the same as the current level reached, in order to prevent clicks, depending on voice stealing and other polyphonic settings: this choice is automatic.
If a Sustain node is specified, the search for a matching level will not go past this Sustain node, and if no suitable level is found, the envelope level will be stuck to the Sustain node level (after a quick cross-fade), otherwise the Sustain stage could be skipped.
You can set the Retrig Always Resets to always force a position reset on re-trigger in the modules properties panel.
Important note: Please do not set this option when the module works in polyphony, otherwise clicks will occur!

The Gate Off logic.

No Sustain point set:
If no Sustain point is specified, Gate Off events are ignored and the envelope operates in the “one-shot” mode.
Sustain point set:
If a Sustain point is specified and the envelope generation has reached it already, a Gate Off event will resume envelope generation from the Sustain point all the way to the Release stage.
If a Sustain point is specified and a Gate Off event is received before reaching the Sustain point, the envelope behavior may vary depending on the following factors:
1) If the absolute value of the current level is higher than the absolute value of the Sustain level, envelope generation will proceed from the Sustain node after a very quick ramp to the Sustain level, to avoid clicks.
2) If the absolute value of the current level is lower than the absolute value of the sustain level, the envelope will proceed from the Sustain point scaling and shifting the Release stage, so that the Sustain level matches the current level, while the end release remains unchanged
Please note:
Please understand that the gate-off behaviour in Signed mode may not always be optimal, but however, unfortunately a universally good solution probably does not exist.

Clipping of curves.

Important Note: Curve interpolation modes can at times produce values beyond the Overall Level set. Such out of range values can be clipped by the module to prevent problems with other modules by enabling Clip Shape in the modules properties panel.

Attack and Release velocity scaling

The durations of the Attack and Release stages can be scaled independently by using keyboard Velocity. A Velocity value from 0 to 10 V will cause a gradual shortening of the duration specified up to a maximum scaling factor specified with the Attack Vel Scal and Release Vel Scal plugs, respectively (the allowed range is 1x to 10x). This means that the harder the keys a depressed the shorter the times become.
Note: When no Sustain node is specified, the whole envelope is considered an Attack stage and the Release Vel Scal value is ignored. This is especially useful with some sounds like violins, to easily control the attack and release time with your keyboard’s note-on and note-off velocity, for realistic performance.
Note: to properly scale the Release stage, your MIDI controller must transmit a valid Note-Off Velocity value.
Important: Cheap keyboard controllers usually set Note-Off Velocity to zero or to a bogus value; therefore, it is always better to leave this as an option for the user.
Note: Please remember that velocity value is sampled only at the instant the Gate turns On or Off.

Level Velocity scaling.

The overall envelope level can be scaled by keyboard Velocity by a variable amount, which can be specified with the Level Vel Scal plug.
Note: The velocity value for this purpose is sampled only the very instant that the Gate turns On or a note switch on a same voice occurs. Any further changes or modulations will be ignored. LFO (tremolo) or Aftertouch level modulations, if required, must be performed after this module.

Position Output.

The Norm Pos output plug constantly outputs the current envelope position as a normalized float value i.e. between 0 and 1. This plug together with a Patch Memory Float Out can be used for visual feedback, i.e. to drive a vertical moving line overlaid on the Shape Editor.
This is also suitable for polyphonic usage (the position for the newest voice playing will be plotted)

Hint: You can use the Shape Node Selector module to greatly simplify the selection of the Sustain node.

Shape Editor 6 Help File. (Edited)

This is a fully configurable graphical editor for standard ED Shapes using the new efficient binary BLOB transmission format.
Note:
The “Legacy” Shape format (string-based, and using Volts values) is still supported to allow for entering Shapes as strings by hand or through the appropriate conversion modules provided for compatibility.
However: The legacy mode usage for shape transmission should now be avoided.

Keeping it simple.
There are also compact, and ultra-compact versions of the module included, which occupy less space in the structure view, by having fewer plugs exposed (most times you may not need to have all the plugs visible for connection anyway).
Stacking shape editors:
More shape editors can be stacked making the background transparent.
In this case, to still allow editing of the background editor (click-thru), the bool option for LockAddRemNodes must be enabled or Editing must be disabled totally for the foremost editor, otherwise any mouse click in empty areas will be intercepted.

Features and usage:

Shapes: Shapes support from two to 100 nodes. A shape can never have less than two nodes. No such thing exists as an “empty” shape: a “void” or default shape is a shape with just the first and the last node set to zero.
Nodes: What are these node things? They are points that you specify to define the shape, set within an X-Y axis. The values define the positions of the points defining the curves.
Node values: Node values are internally represented in normalized float units: Vertically from 0 to, and including 1.
Horizontally, from -1 to, and including 1.
Compatibility: However, for compatibility reasons, node positions are still displayed, and accepted in Volts by all the ED Shape modules:
Horizontally from -5 to +5 Volts.
Vertically from -5 to +5 Volts.
First and last nodes: The first and the last node are fixed at the positions -5 and +5 and cannot be moved horizontally. This is intentional and not a bug.

“Legacy” string format:

The legacy format consists of a series of nodes defined between parentheses in Volt units, e.g. (-5,0)(1,-1)(5,1).
Legacy First and Last nodes: The first and the last node must always be present, and have the positions -5 and 5 respectively, and they must all be sequential. Vertical positions: The vertical node positions must be in the -5 to 5 range.
No other characters or spaces are permitted. Invalid strings will be rejected.
(This format was inherited from the stock SynthEdit WaveShaper 3)

New BLOB shape format:

Shape information is now stored and transmitted using a new efficient binary BLOB format (Binary Large OBject if you like your acronyms).
Every Shape Editor must therefore be linked to the destination user module(s) via a Patch Memory Blob module. (Diagram below)

Adding and removing shape nodes.
Shape nodes can be added or removed by a double-click.
New nodes: A double click anywhere in and empty space in the editing field will create a new node at the corresponding mouse position.
Removing Nodes: Double-clicking on a selected node will delete
it (unless deletion is disabled, see later).
The first and last nodes cannot be deleted: a double click on a node which can’t be deleted will snap it to the specified baseline for convenience.
Moving Nodes: Shape nodes can be selected with a mouse click and dragged around within their allowed limits:
1) Between the neighboring nodes, and
2) Vertically within -5 and 5 or within a smaller range, in case of a custom range of MinY/MaxY values being specified.
Interpolation: Interpolation Type is still transmitted separately from Shape data. Since different Shape-utilizing modules may support only certain Interpolation Types or even just one, their DSP List pin is always properly set to back-transmit this information to the main Patch Memory List, whose Value plug must be connected to the corresponding Shape Editor plug, and which will be automatically configured to only list the supported mode(s). The connection method is shown below in use with the ED Shape Envelope module. (Ultra Compact module shown for simplicity)


Important note: Users must never make any assumptions about the list position of Interpolation Types and their corresponding integer values, since they might change in the future and/or more Types could be added upon need.

Plugs and Parameters

<->Shape I/O: The input-output Plug for the BLOB description on the shape.

<->Interpolation Choice In: Specifies how the Shape is to be interpolated always use the connection method shown with a Patch Memory List Module!
Shape Interpolation Types:
None : This mode does not correspond to any physical interpolation and is module-specific. It really means that a module actually only needs node positions (e.g. to render spectral peaks or sinc pulses …) and not represent an actual curve. The Shape Editor will simply draw vertical lines starting from the specified baseline. In general, this option can be useful to have a Shape representing just a set of points.
Important: Not all modules support ” None”.
Note: when the Interpolation Type is set to None, the nodes can slide freely beyond the adjacent ones for convenience.
Linear:
This plain linear interpolation (default). This results in a straight line, and no smoothing at all.
Curve 1:
Equivalent to the former “Spline” method, this method uses modified cubic splines for smoothing.
Notes: This is a Curve interpolation which will never fluctuate but can still result in unsmoothed transitions from intervals of very different width, however it still produces a very smooth result (almost comparable to Curve 2) when used with uniformly spaced nodes.
Curve 2:
Natural cubic splines. This Interpolation method always produces a smooth curve (second derivative is always continuous) at the expense of sometimes producing huge fluctuations, when used on node intervals much smaller than their neighbouring node spacings.
Edit X, Edit Y Plugs: A pair of Float editing pins is linked to the currently active node, so that its x,y values can be displayed and sent to the module if needed, by connecting a couple of suitable modules.
Note: The old left hand side edit pins have now been removed, to prevent undue connection of Patch Memories which would result in conflicting double storage.

<->Active Node I/O: The index of the active node, as available at the Active Node plug, is not internally stored in any parameter. To maintain it throughout sessions, you must connect it to a Patch Memory Int module. This can be output, or alternatively supplied as a value to select a particular node when working with a fixed number of nodes (obviously).
Note: when Interpolation Type is set to None, nodes are free to slide beyond
any adjacent ones. For this reason, the Active Node index can change while sliding
a node horizontally.

->Editable: The editor can be set to read-only mode (all editing is fully disabled, this is useful for parameter display purposes)

->Lock X: The Horizontal position of all the nodes nodes can be locked, restricting the the user to editing their vertical positions.

->Lock Add/Rem Nodes: Addition and removal of nodes can be disabled, to restrict working to a fixed number of nodes.

->Lock First/Last Nodes: Editing for the first and last node can be disabled, this prevents users adding values that could cause loud clicks.

->Y Max/Y Min: Values supplied to these plugs set range for vertical positions and limited them within a minimum and a maximum range.

->Base Line: The vertical position of a convenient reference baseline can be specified (it is zero by default).
Notes on the Baseline:
1) Shape fill gradients will be drawn originating from the specified baseline.
2) Double clicking on a node which cannot be deleted (like the first and the last node, or all nodes when addition/removal is disabled) will cause the node to be snapped to the specified baseline.
3) When no default shape is specified in the Reset Value pin, a two-node straight line shape at the baseline will be used as the default.
For example, when the shape represents positive values, it makes sense to place the baseline at the bottom (-5), and when the shape represents a spectral filtering curve, it may be more logical to set the baseline at top (+5), again when it represents signed values, the baseline is more logically
placed in center (zero) position.

->Reset Value: Specify a shape in the legacy string format to use as default value for the Reset plug. If no shape is specified (empty plug string), a straight two-points shape (line) at the specified baseline will be used as default

->Mouse Down Has the value 1 (True) when the user clicks on the editor screen area

-> Node Size: Size of the Node handles in Pixels. The size range is from 4 to 20px.

->Node Thickness: The thickness in pixels of empty node handles, from 1 to 4 px

->Circular Nodes: When set to True draws circular node handles rather than square.

->Fill Nodes (I) : When set to true draws filled node handles rather than empty.

->Shape Thickness: Sets the thickness in pixels of the shape curve, from 1 to 4px.

->Border % Sets the percentage of border area, expressed as a percentage of every dimension, from 0 to 25.
Example: If the setting is 25, then the left and right borders will both use one 25% of the box width, and the top and bottom borders will both use 25% of the box height.

->Border Clip: When this plug is set to True it clips parts of the interpolated shape which may result in values larger than +5 or smaller than -5 (usually because of curve interpolation) from being drawn in the border area, and replaces them with a clipping line.
Note: Most shape-utilizing modules doe not clip values internally. But when they do, this is always clearly specified. Therefore, always set this pin
in a consistent way, since a clipping line in the editor can be misleading

->Grid Horiz Divs: This plug sets the number of horizontal (X) grid divisions.
from 0 to 40

->Grid Vert Divs: This plug sets the number of vertical (Y) grid divisions.
from 0 to 40

These Plugs are on the RHS
->Edit X: A float pin linked to the currently active node, to read or change its
horizontal value externally.

->Edit Y: A float pin linked to the currently active node, to read or change its
vertical value externally.

->Reset: When set to true the module reverts to the default shape specified in the Reset Value plug. If no default shape is specified (empty plug value), a straight two-nodes shape (line) at the specified baseline will be used as default for convenience.

->Flip X: When set to true the current shape is flipped horizontally.

->Flip Y: When set to true the current shape is flipped horizontally.

Internal (Properties panel) settings:
>Edit Units: You can specify whether to use Volts (“legacy”, default), or native Float units for the two Edit plugs.
Important: Please remember that the Volts range is [-5,+5] in both X and Y axis, while Float range is [0,1] X and [-1,+1] Y.

ARGB Colours: 32 bits color (i.e. including alpha channel) can be specified for every graphical element of the editor as a 32 bits Hex string (e.g 80FFFF00 is a 50% transparent yellow), allowing customization of the colours and transparencies. Note: When the alpha channel (first byte) is set to zero, the corresponding foreground element won’t be drawn at all. In case of the Background, setting an alpha channel smaller than FF will progressively reveal other GUI controls placed in the background in the Panel view.
The ARGB Colours that can be set are:
BG Top
BG Bottom
Grid
Base Line The defined horizontal base line/Axis
Vert Line The centre vertical axis
Shape – The line drawn defining the shape.
Fill Grad 1 Fill grad is easier to show-
Fill Grad 2
Nodes
Active Node

Example – In the image below:
Base Line is set to FFFFFF00 (100% Red, 100% Green)
Vert Line is set to FF00FFFF (100% Green, 100% Blue
Fill Grad 1 is set to FF00FF00 (100% Green)
Fill Grad 2 is set to FF0000FF (100% Blue)
Shape is set to FFFF0000 (100% Red)

Using the CTRL key supports precise movements
Note: With SE 1.4 the CTRL precision mode does not work in the Structure View.

« Older posts