1. OVERVIEW
The wavetable has 4 keyframes (KF1–KF4) at table positions 0, 0.33, 0.67 and 1. Each keyframe is one equation y(p) describing a
single cycle of a waveform. The 33 slices between keyframes are linear crossfades of their neighbours. Edit an equation in the box beside its slice
in the 3D view, and the terrain and sound update on every valid keystroke.
2. THE EQUATION
- Write a single expression that returns a number. There are no statements, no
y = prefix and no semicolons.
- The only variable is
p, the phase of one cycle, running from 0 to 1.
-
The output
y should stay roughly within -1 to +1. Values are hard-limited to ±2 when baked, and the terrain draws ±1 at full
height.
- The equation is sampled at 1024 points and interpolated, so sharp jumps are rendered with a tiny slope.
0.85*sin(tau*p) + 0.25*sin(2*tau*p)
3. OPERATORS
| + - * / % |
Arithmetic. % is the remainder, which can be negative for negative inputs. |
| ** |
Power, e.g. p**3. Same as pow(p,3). |
| ( ) , |
Grouping and function arguments. |
| < > == ! |
Comparisons give 1 or 0 in arithmetic, e.g. (p<0.5)*2-1. |
| ? : |
Conditional: p<0.25 ? 1 : -1. |
| && || |
Logical and/or. |
Warning: ^ is bitwise XOR, not power. Use ** or pow(). Only characters in
0-9 a-z + - * / % ( ) . , < > = ? : ! & | ^ are accepted.
4. FUNCTIONS
| sin cos tan |
Trigonometry, argument in radians. A full cycle is sin(tau*p). |
| tanh atan |
Soft saturators. tanh(k*x) squares off a signal as k grows. |
| abs sign |
Absolute value and sign (-1, 0, 1). |
| sqrt pow exp log |
Roots, powers, exponentials, natural log. log and sqrt of negatives give NaN, which is rejected. |
| floor ceil round |
Rounding. Useful for stepped and quantised shapes. |
| min max |
Smaller or larger of its arguments. Combine for clipping: max(-0.5, min(0.5, x)). |
| fract(x) |
Fractional part of x, in [0, 1). |
5. PERIODIC HELPERS
These take their argument in cycles, not radians, and repeat every 1.0. tri(2*p) gives two triangle cycles across the frame.
| tri(x) |
Triangle wave, -1 to 1, starting at 0 and rising. |
| saw(x) |
Rising ramp, -1 to 1. |
| sq(x) |
Square wave, +1 for the first half cycle, -1 for the second. |
6. CONSTANTS
| pi |
3.14159… A half cycle: sin(pi*p) is a single hump from 0 to 1 and back to 0. |
| tau |
2π = 6.28318… Use sin(tau*p) for one sine cycle. |
| e |
2.71828… |
7. RECIPES
| Sine |
sin(tau*p) |
| Additive (harmonics) |
sin(tau*p) + 0.5*sin(2*tau*p) + 0.25*sin(3*tau*p) |
| Soft square |
0.85*tanh(4.5*sin(tau*p)) |
| Hard square |
0.8*sq(p) |
| Rising saw |
0.85*saw(p) |
| Pulse (25% width) |
p<0.25 ? 0.8 : -0.8 |
| Phase modulation (FM) |
sin(tau*p + 3*sin(tau*p)) |
| Octave-stacked sines |
0.6*sin(tau*p) + 0.4*sin(tau*2*p + 1) |
| Windowed harmonic (formant) |
0.5*sin(tau*p) + sin(5*tau*p)*sin(pi*p) |
| Decaying burst |
sin(6*tau*p)*exp(-4*p) |
| Wavefolder |
sin(3*sin(tau*p)) |
| Sine + triangle blend |
0.5*sin(tau*p) + 0.5*tri(p) |
| Hard clip |
max(-0.6, min(0.6, 1.5*sin(tau*p))) |
| Bit-crushed sine |
floor(sin(tau*p)*4)/4 |
8. TIPS
-
Seamless loop. A waveform is smoothest if
y(0) equals y(1). A raw saw jumps there, which sounds bright and buzzy.
That may be what you want.
-
Use whole harmonics. Multiply
tau*p by integers (1, 2, 3…) to keep the pitch stable. Fractional multiples like
1.5*tau*p break periodicity and add a click at the loop point.
-
Morphing. Keyframes with similar structure, such as the same harmonics at different amplitudes, morph smoothly. Very different shapes give
brief mixed in-between waveforms.
- DC offset. A constant term like
+0.3 shifts the wave, wasting headroom. It is not removed.
-
Aliasing. Tables are not band-limited. Bright equations such as
sq(p), or sines with high harmonics, alias on high notes. Use
the filter, or play lower notes.
-
Warp stage. Warp (bend, fold, sync, FM) is applied to the phase after your equation is looked up, so it works on any custom shape.
9. EDITOR BEHAVIOUR & ERRORS
- The slice for the focused equation turns black. The red slice is the current playback position.
-
An invalid equation turns the field red and shows the reason in its header:
empty, bad character, a syntax message, or
NaN at p=… if the result is not a finite number at any of six test points. The last valid sound is kept.
- Leaving the field restores the last valid equation. Enter or Esc leaves the field.
- Typing in a field never plays piano keys or triggers sequencer shortcuts.
- Edits are kept per bank when you switch banks. RESET EQ restores the defaults for the current bank.
- Open this manual with MANUAL, F1 or ?. Close it with Esc, CLOSE or by clicking outside.