Back to Index

Update: 2020-06-15

Table of Contents

CubicPadSynth

CubicPadSynth is a wavetable synthesizer which uses PADsynth algorithm to generate oscillator tables. Cubic interpolation is used to get smooth sound even at inaudible low frequency range. LFO waveform can be directly drawn.

CubicPadSynth requires CPU which supports AVX or later SIMD instructions.

The package includes following builds:

macOS build isn’t tested because I don’t have Mac. If you found a bug, please file a issue to GitHub repository or send email to ryukau@gmail.com.

Linux build is built on Ubuntu 18.0.4 and tested on Bitwig 3.1.2 and Reaper 6.03. Bitwig 3.1.2 seems to have a bug that occasionally blackouts GUI.

Installation

Plugin

Place *.vst3 directory to:

DAW may provides additional VST3 directory. For more information, please refer to the manual of the DAW.

Presets

Extract preset zip, then place preset directory to the OS specific path:

Preset directory name must be the same as the plugin. Make Uhhyou directory if it does not exist.

Windows Specific

If DAW doesn’t recognize the plugin, try installing C++ redistributable (vc_redist.x64.exe). Installer can be found in the link below.

Linux Specific

On Ubuntu 18.0.4, those packages are required.

sudo apt install libxcb-cursor0  libxkbcommon-x11-0

If DAW doesn’t recognize the plugin, take a look at Package Requirements section of the link below and make sure all the VST3 related package is installed.

REAPER on Linux may not recognize the plugin. A workaround is to delete a file ~/.config/REAPER/reaper-vstplugins64.ini and restart REAPER.

Color Configuration

At first time, create color config file to:

Below is a example of style.json.

{
  "fontPath": "",
  "foreground": "#ffffff",
  "foregroundButtonOn": "#000000",
  "foregroundInactive": "#8a8a8a",
  "background": "#353d3e",
  "boxBackground": "#000000",
  "border": "#808080",
  "borderCheckbox": "#808080",
  "unfocused": "#b8a65c",
  "highlightMain": "#368a94",
  "highlightAccent": "#2c8a58",
  "highlightButton": "#a77842",
  "highlightWarning": "#8742a7",
  "overlay": "#ffffff88",
  "overlayHighlight": "#00ff0033"
}

Hex color codes are used.

First letter # is conventional. Plugins ignore the first letter of color code, thus ?102938, \n11335577 are valid.

Do not use characters outside of 0-9a-f for color value.

Controls

Knob and slider can do:

There is an additional control for number sliders used for Octave, Seed etc.

Control with many blue vertical bars (BarBox) have some keyboard shortcuts. LFO Wave on Main tab and Gain, Width, Pitch, Phase on Wavetable tab are using BarBox. Shortcuts are enabled after left clicking BarBox and mouse cursor is on the inside of BarBox. Cheat sheet is available on Infomation tab.

Input Control
Ctrl + Left Drag Reset to Default
Shift + Left Drag Naive Draw (Skip bars between frames)
Right Drag Draw Line
a Alternate Sign
d Reset Everything to Default
D Toggle Min/Mid/Max
e Emphasize Low
E Emphasize High
f Low-pass Filter
F High-pass Filter
i Invert Value (Preserve minimum)
I Invert Value (Minimum to 0)
n Normalize (Preserve minimum)
N Normalize (Minimum to 0)
p Permute
r Randomize
R Sparse Randomize
s Sort Descending Order
S Sort Ascending Order
t Subtle Randomize (Random walk)
T Subtle Randomize (Converge to 0)
z Undo
Z Redo
, (Comma) Rotate Back
. (Period) Rotate Forward
1 Decrease
2-9 Decrease 2n-9n

Some BarBox has scroll bar to zoom in. Scroll bar has handles on left end and right end. To control zoom, use Left Drag on one of the handle. Scroll bar also has following controls:

Caution

Pressing Refresh LFO or Refresh Table button stop sound. They also stop all midi notes.

Wavetable Specification

Length of a wavetable is 2^18 samples.

136 band-limited wavetables are generated for each MIDI note. Pitch bending is supported as high as 21100 Hz. 21100 Hz is derived from MIDI note number 136. Frequency of MIDI note number 137 is higher then 22050 Hz. That’s why 136 is selected.

When fundamental frequency of a note is lower than 8.18 Hz, some overtones on high frequency may lost. However, cubic interpolation may cause noise which makes those frequency not to be 0.

noteToFreq(note) := 440 * Math.pow(2, (note - 69) / 12)
noteToFreq(0) = 8.175798915643707
noteToFreq(136) = 21096.16364242367
noteToFreq(137) = 22350.606811712252

Wavetable is represented as 2D array with size of 136 * 2^18. Bicubic interpolation is used to get the value from the table. Coordinate on time/band-limit axis is determined by phase and frequency of oscillator.

The size of wavetable is large for a synthesizer. Xrun may occur if memory is slow. It may also consume more resources for higher notes because access pattern becomes close to random.

PADsynth Algorithm Overview

CubicPadSynth uses PADsynth algorithm, which is originated from ZynAddSubFX. Yoshimi is also using PADsynth algorithm.

Passing phase randomized spectrum to IDFT (inverse discrete fourier transform) generates a cyclic waveform which is smooth when connecting an end to another end. PADsynth is utilizing this property.

“Profile” function is used to synthesize spectrum. CubicPadSynth uses normal distribution curve for profile, which is same as original PADsynth algorithm. Center frequency of profile can be set arbitrary. In default, CubicPadSynth uses fundamental frequency set by Base Freq. and its overtones.

Block Diagram

If the image is small, use Ctrl + Mouse Wheel or “View Image” on right click menu to scale.

Diagram only shows overview. It’s not exact implementation.

Parameters

Main Tab

Tuning

Octave, Semi, Milli

Changes master pitch.

Milli is 1/1000 of semitone or 1/10 cent.

ET, A4 [Hz]

Changes tuning.

ET stands for equal temperature. Note that when ET is less than 12, some notes becomes silent due to frequency becomes too high or too low.

A4 [Hz] is frequency of note A4.

Gain

A, D, S, R

Gain envelope parameters.

Gain

Master output gain.

Lowpass

This is a psuedo low-pass filter. It shifts to wavetable which contains less overtone to get low-passed output.

Equation to get cutoff frequency is following.

cut = Cutoff * 128
keyFollowRange = Cutoff * (nTable - pitch)
lowpassPitch = (cut + KeyFollow * (keyFollowRange - cut)) - lowpassEnvelope * Amount;
if (lowpassPitch < 0) lowpassPitch = 0

noteToFreq(note) := 440 * Math.pow(2, (note - 69) / 12)
range  = noteToFreq(nTable)
lpFreq = noteToFreq(midiNote + lowpassPitch)
ntFreq = noteToFreq(midiNote)
cutoffFrequency = (1 + (range - lpFreq) / range) * ntFreq

128 used to calculate lpCut is an arbitrary value which came from MIDI note number range + 1. nTable is set to 136.

Cutoff

Changes filter cutoff frequency.

KeyFollow

When set to right-most, cutoff frequency is set to make the number of overtone to be almost same regardless of pitch of note. When set to left-most, it only use the value of Cutoff.

A, D, S, R, Amount

Filter envelope parameters. Amount changes the amount of modulation to cutoff.

Pitch

A, D, S, R, Amount

Pitch envelope parameters.

Negative

Changes the sign of pitch envelope output.

Unison

nUnison

Number of voices used by unison.

To avoid interruption of release, increase the number of nVoice in Misc. section. Note that increasing nVoice consumes more resources.

Detune, Random Detune

Detune is the difference of pitch between voices used in a unison.

When Random Detune is checked, amount of detune changes for each note-on.

random = RandomDetune ? rand() : 1
detune = pitch * (1 + random * unisonIndex * Detune)
GainRnd

Amount of randomization of gain for voices used in a unison.

Phase

Amount of randomization of phase for voices used in a unison.

This parameter makes no effect when Reset in Phase section is checked.

Spread, Spread Type

Spread is an amount of stereo spread for a unison.

Spread Type provides options to assign panpot values according to voice pitch.

LFO

Refresh LFO

Refresh LFO wavetable based on current value of LFO Wave.

Note that refreshing wavetable stops sound. It also interrupts MIDI notes.

Interpolation

Type of LFO wavetable interpolation.

Tempo, Multiply

Sets LFO frequency according to current tempo. Lower numeral represents the length of note. Upper numeral is the number of notes.

Value of Multiply is multiplied to the frequency calculated from Tempo.

// (60 seconds) * (4 beat) = 240
lfoFrequency = Multiply * (BPM / 240) / (TempoUpperNumeral / TempoLowerNumeral)
Retrigger

When checked, resets LFO phase for each note-on.

Amount

LFO frequency modulation amount.

Lowpass

Changes cutoff freequency of low-pass filter for LFO.

LFO Wave

LFO waveform.

Phase

Phase

Initial phase of oscillator.

Reset

When checked, resets oscillator phase to the value set by Phase.

Random

When checked, randomize phase for each note-on. In this case, value of Phase becomes range of randomization.

Misc.

Smooth

Time length to change some parameter value to current one. Unit is in second.

List of parameters related to Smooth. * represents wild card.

nVoice

Maximum polyphony. Lowering the number of this option reduces CPU load.

Pool

When checked, most quiet note is released when the number of active voice is close to maximum polyphony. This can be used to reduce pop noise which occurs on note-on.

Wavetable Tab

Overtone Controls

Gain

Gain of profile.

Width

Width of profile.

Pitch

This value is multiplied to profile center frequency.

Phase

Range of randomization for the phase of profile.

Pitch

Base Freq.

Fundamental frequency of wavetable. Note that if this value is small, master pitch becomes out of tune.

Multiply, Modulo

Changes profile center frequency.

profileCenterFrequency = mod(
  BaseFreq * profileIndex * overtonePitch * Multiply,
  440 * pow(2, (Modulo - 69) / 12)
)
Random

When checked, randomize profile center frequency. Ignores values of Pitch in overtone control.

Spectrum

Expand

Scaling factor to shrink/expand the spectrum along to frequency axis.

Shift

Shift spectrum along to frequency axis.

Comb

When this value is higher than 1, it changes the shape of profile like a comb. The value specifies interval between peaks.

Shape

Changes profile shapes by using the value of Shape as an exponent.

shapedProfile = powf(profile, shape);
Invert

Invert spectrum to make the maximum of absolute value to 0, and 0 to the max-abs value. Signs are preserved. Phases aren’t considered.

maxRe = max(abs(spectrumRe))
maxIm = max(abs(spectrumIm))
invertedSpectrumRe = spectrumRe - sgn(spectrumRe) * maxRe
invertedSpectrumIm = spectrumIm - sgn(spectrumIm) * maxIm

Phase

UniformPhase

When checked, phase of a profile becomes an uniform value.

Random

Seed

Random seed. This value change random number sequence.

Modifier

Gain^

Exponent for Gain in overtone control.

profileGain = pow(Gain, Gain^)
Width*

Multiplier for Width in overtone control.

profileWidth = Width * (Width*)

Refresh Table

Refresh PADsynth wavetable based on current configuration of Wavetable tab.

Note that refreshing wavetable stops sound. It also interrupts MIDI notes.

Change Log

Old Versions

License

CubicPadSynth is licensed under GPLv3. Complete licenses are linked below.

If the link above doesn’t work, please send email to ryukau@gmail.com.

About VST

VST is a trademark of Steinberg Media Technologies GmbH, registered in Europe and other countries.