SYNTHR EXPRESSIONS

The wavetable oscillator in SynthR supports creating custom wave tables from expressions.
They can be really short and simple but can be extended to longer expressions.
These expressions are build from normal math operators, numbers, variables and functions.

Operators
+ Plus
- Minus
* Multiplication
/ Division
^ Power of
% Modulo


Magic Variables
x Current time position in wave table from -1 to 1
w Like x but from 0 to 1
y Current table position from -1 to 1
z Current table position from 0 to 1
pi Pi, 3.141592...
e E, 2.718281...
window1 Raised cosine (Hann) windowing function
window2 half sine window
window3 A wider version of window1


Functions
sin sinus
cos cosinus
tan tangens
atan arc tangens
abs absolute value
sign Give sign of value, 1 for positive values, -1 for negative
sqrt Square root
rint Round to nearest int
tfold triangle fold. Whenever a value goes above 1 it mirrors back, same with below -1
tri Full triangle wave from 0 to 1. Same as tfold(4*input)
wrap Wraps values to stay inside -1 and 1
saw Full saw wave from 0 to 1. Same as wrap(2*input)
square Full square wave from 0 to 1. Same as sign(wrap(inputx*2))

Lets make a nice squealy wavetable, step by step.
Lets start with a simple triangle wave.

tri(w)

That's all for making a simple triangle wave! So far it is same for all wave table positions, let's fix that by making use of the z variable.

tri(w*(1+5*z))

Lets break this down. z goes from 0 to 1, but we rather want to start with 1. that's why we add the 1+ part.
5*z is added to make the effect a bit more dramatic.
Now we go from one triangle cycle to a total of 6 cycles when moving the "pos" knob.

This is already quite useful hard sync like sound but can be improved more.
When not having an integer number of triangle cycles it will end on something not 0 thus having a sharp edge. This can indeed sound good but it is not quite what we want here so lets add a window. Just multiply the whole expression window3.

window3*tri(w*(1+5*z))

Let's take things one step further and add triangle folding in to the shape. This is done by wrapping the expression in tfold.
To have anything folded back we need to increase the volume within so lets use the same trick with z as before by multiplying with *(1+2*z)

tfold(window3*tri(w*(1+5*z))*(1+2*z))

Now we have a nie wavetable!
We can make simple changes that will have dramatic effects like changing tri to square or saw, or replacing tfold with wrap.

A tip if you if you think your wavetables sound too ringy or squealy try adding some phase modulation (Rightmost knob in wavetable). Set to "asym plus", a little bit goes a long way.

Happy tweaking!