Synthedit help and tutorials

Stuck with a SynthEdit project?

Page 4 of 20

Dual Wave Bending/Morphing Oscillator.

Generate complex and variable waveshapes.

This Oscillator combines two methods of waveshaping and shape modulation.
There is a DAM Waveshaper on the output of each VCO, and there is the facility to Morph between two waveshaping formulae, the sum of the formulae, and the difference between the two formulae. The phase of the second VCO is also variable, and if required there is a quantized input to raise or lower the second VCO in octave steps. The sum of the two Waveshapers is achieved when the Morph point is mid way between the ASin h and ATan h points.
The only reason I chose to use the two particular methods of waveshaping (ASin h and ATan h) were that they gave the widest, and most useful range of waveshapes at the output (feel free to experiment).
The bias voltage on the audio signal input allows further variation in the output waveshape. The phase of the second oscillator also affects the resulting shape when the output is the sum or difference of the two waveshapes. So we can introduce more harmonics and waveshapes into the output I have included a third oscillator which is not used in the audio, but just to phase modulate the second audio oscillator. The High Pass Filters are all set with their pitch/voltage at the 1 kHz/Volt setting to save calculating the frequencies. These are merely for blocking LF rumbles and DC from the audio output.
Note: Taking the Bend 1 and CVs outside the -4.5 to + 4.5 volts would be of no benefit as this will result in very little output.
Note: There is a High Pass Filter in the output to prevent DC or very low frequencies resulting from the Phase Modulation (this can produce large amounts of aliasing, so there is the possibility of reflected “harmonics” and DC).
Note: I did briefly experiment with using a Feedback (Volts) module to use the audio output to produce the phase modulation, but this proved to be too extreme and unpredictable in it’s results.
Note: I used the HD Oscillators from the Community Modules download from the Synthedit website as these give a slightly better waveform with a greater harmonic range.
Note: Don’t bother trying oversampling on this structure, I experimented and found that if anything it decreased the range of sounds (less high frequency content)

As you can see from the screenshot below this structure produces some interesting waveforms, and harmonic (and inharmonic) structures, which with the correct low frequency CV’s can produce some more unusual (and possibly un-musical) audio outputs..
Note: Although the VCO’s allow selection of Pink Noise, White Noise, and Pulse waveshapes none of these produce any interesting outputs (to me anyway).

The prefab in action

The prefab for this module can be found on the files section of synthedit@groups.io (click link to download).

Formant Synthesis Part 2

Applying the basics of Formant Synthesis.

The basic idea is to take three bandpass filters connected in parallel. Here we use three SV filters set to their 2 Stage Bandpass mode, each one followed by a Level Adj module so we can adjust the three parameters we need:
1) Frequency
2) Resonance or “Q”
3) The audio level of each filter.
Each of these three filters represents a Formant.

By connecting white noise to the input and a frequency analyser to the output we can see the filter in operation- (by using white noise it’s easier to see the resonant peaks than it is with a pulse or sawtooth). You can see below how I have set some frequencies and the resonant peaks corresponding to those frequencies are clearly visible.

This method has some disadvantages though;
1) The stock SV filters are fixed into 1 Volt per Octave for the Pitch control meaning we have to do some maths and use extra modules to convert the readout into a Hz or kHz readout.
2) The stock SV filters tend to oscillate and ring at high resonance levels.
3) Three separate filters, and the maths and extra modules for displaying the filter frequency will all add to the CPU use.

A more Efficient Formant filter.

Fortunately there is a purpose built filter module in the TD modules range, the TD_SVX4.
It is a module that does the job of four SV filters, with the advantage that the Frequency control voltage is 1 Volt per kHz, making readout easier, and they are optimised so as not to “ring” or oscillate at high resonance levels.
This makes quite a neat and more CPU efficient solution for a Formant filter.

The structure of the dual TD_SVX_4 container is shown below. I used two filters to get a steeper bandpass response. You can see below the filter in operation with the four resonant peaks (again using a noise input). Even at maximum resonance there is no ringing or oscillation

Not just for speech.

By their nature acoustic instruments also have resonant frequencies, so we can use our formant filter to make more accurate imitations of acoustic instruments by adding resonances to their audio spectrum. The chart is shown below, note how some resonances are quite broad compared to others.

InstrumentF1F2
Flute800
Oboe14003000
English Horn9302300
Clarinet1500-17003700-4300
Bassoon440-5001220-1280
Trumpet1200- 14002500
Trombone600-800
Tuba200-400
French Horn400-500
Cello300500 + 900
Double bass70250
Viola220350
Violin5031600
Acoustic guitar90-150

More on acoustic instruments and formants.

Note: The Formant frequencies of acoustic stringed instruments are by no means set in stone. These vary from instrument to instrument, as there are a large number of variables affecting the sound, such as differences in construction, differences in materials etc. Different styles and models of acoustic guitar will have different resonances, but generally speaking the resonance will be in the lower frequency end of the scale as these are the weaker frequencies and need boosting to make the sound project evenly across the playing range.
Even “classical” instruments such as Violin and Viola will have different resonances due to the way they are constructed.

The best way to find the frequencies for these instruments is experiment, and find the sound that seems right to your ears, and experience of acoustic instruments.

Formant Synthesis Part 1

Formants.

What are Formants?
In the study of acoustics, speech and phonetics a formant is the part of the audio spectrum, which has a large peak in volume that results from the acoustic resonances formed by the human vocal tract, or by a room or hall.
By their nature when sound waves are created in a room some frequencies will be attenuated, and some will be boosted due to the shape and size of the room. In a room there are not only the direct sound waves that we hear, but also the reflections from the walls, and from furniture. If you want to find out more about room resonances there is an article on Wikipedia.
This also applies to human speech as well due to the mouth and vocal tract forming resonant cavities, only in this case when we create speech we are changing the dimensions of those cavities.

Formants in Acoustics.

In acoustics, a formant is usually defined as a broad peak, or local maximum, in level of the audible spectrum.
For harmonic sounds, the formant frequency is sometimes taken as the harmonic that is most strongly boosted by a natural resonance. A room can be said to have formants which characteristic of that particular room, due to its resonances, which are due to the size and shape of the room, this resonance will also be affected by the contents of the room, and any sound damping materials in the room. Room formants of this nature reinforce themselves by emphasizing specific frequencies and cancelling others. For the purposes of digital signal processing such as reverb, the way a collection of formants generated by a room or hall affects a signal can be represented by an impulse response.

Speech Formants.

In speech the formants are characteristic of the resonances of the the vocal tract which is formed by the following; The lungs, the Larynx, the vocal cords, the throat, the mouth, the palate, the shape and position of the tongue, the lips and teeth all affect the formants.
These formants make up all the sounds we recognize as vowels, and to a lesser degree also make up the sound of the consonants too.
The formant with the lowest frequency is called F1, the second F2, the third F3, and so forth. The fundamental frequency (or pitch)of the voice is sometimes referred to as F0, but it is not a formant. Normally the two first formants, F1 and F2, are sufficient for us to recognize the vowel.
In normal voiced speech, the vibration produced by the vocal cords resembles a sawtooth, rich in harmonic overtones.
If the fundamental frequency (or more often) one of the overtones is higher than one of the resonance frequencies of the system, then the resonances will be weak, and the formant usually produced by that resonance weak or almost completely inaudible. This is usually noticed in the singing of operatic sopranos, who sing at pitches high enough for their vowel sounds to become very hard to distinguish.

Note: Consonants are, to a large degree, noise bursts shaped by the tongue and lips, and we can model these using amplitude contours rather than spectral shapes, so these won’t concern us here.

Approximate frequencies found in vowel sounds. (Not a comprehensive list)

Vowel.Example.F1 Hz.F2 Hz.F3 Hz.
aLap66017002400
eeLeap27023003000
iLip40020002550
ooloop3008702250
“u”lug64012002400

This means that we can use these frequencies in a synthesizer to create roughly human sounding vowels, and “singing”.

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.

« Older posts Newer posts »