Waveform Generator — Custom Waves
Build custom waveforms with Fourier additive synthesis online — 16 harmonic partials, live playback and a real-time waveform view. Free additive synthesizer in your browser. For timbre study.
Tool controls
Protect your hearing. Start at a low volume. Never raise the volume to make a tone audible. Levels are shown in dBFS, relative to full scale — not SPL.
How it works
Audio waveforms are synthesized using Fourier additive synthesis via Web Audio PeriodicWave tables. Wave cycles are rendered dynamically to an HTML5 canvas alongside an oscilloscope time-domain analyzer. All DSP executes locally in your browser.
On this page
This additive synthesizer builds custom waves from 16 harmonic partials with Fourier additive synthesis and plays them through a Web Audio PeriodicWave wavetable, drawing the theoretical cycle and the live output on one canvas. The page is an additive synthesis lab for wave shape and harmonic content, and it runs entirely in your browser.
How to use it
- Start from a preset. Sine Wave, Square Wave, Sawtooth, Triangle, Tonewheel Organ, Bright Brass and Metallic Bell each set all 16 partials at once and redraw the waveform.
- Set the fundamental. The slider covers 40 to 1000 Hz, the number box accepts 20 to 2000 Hz, and the A1 to A5 chips jump to 55, 110, 220, 440 and 880 Hz. The default is 220 Hz.
- Edit the partials. Each of the 16 sliders sets one harmonic from 0 to 100%, and the frequency label under each slider recalculates with the fundamental, so h3 at 220 Hz reads 660 Hz.
- Reshape the rack with the tools. Zero All clears every partial, Odd Only keeps h1, h3, h5 and the rest, Even Only removes the odd partials, and Randomize fills the series with a decaying random set.
- Set the output volume (the slider starts at 40%) and press Play. The status pill names the active preset and frequency while the canvas draws two cycles of the theoretical wave over the live analyser trace.
- Press Stop to silence the tone. Partials apply to a running tone as you move the sliders, so you can hear each change as you make it.
Which harmonics make which shape
A periodic wave is a sum of sine partials, and the recipe decides both its geometry on the canvas and its timbre in the room.
| Preset | Partial recipe | Amplitude law | Character |
|---|---|---|---|
| Sine Wave | h1 only | Single partial | Pure tone with no overtone content |
| Square Wave | Odd partials 1, 3, 5, 7 and up | 4/(nπ), close to 1/n | Hollow and woody |
| Triangle | Odd partials only | 8/(π²n²), close to 1/n² | Mellow and flute-like |
| Sawtooth | Every integer partial | 2/(nπ), roughly 1/n with alternating sign | Bright and cutting |
| Tonewheel Organ | h1, h2, h3, h4, h6, h8, h10, h12 | Fixed drawbar weights from 1.0 down to 0.1 | Rich, chord-like sustain |
| Bright Brass | All partials | 1/n^0.8 tilt with the even partials slightly reduced | Strong upper harmonics, brassy |
| Metallic Bell | h1, h2, h3, h4, h7, h9, h11, h13, h15 | Sparse fixed weights with a bump at h4 | Clangorous and inharmonic-sounding |
The square and triangle share the odd-only recipe, but their amplitude laws separate them: 1/n keeps upper partials audible far up the series, while 1/n² rolls them off so quickly that the wave looks almost like a sine with soft corners. The sawtooth is the only classic shape that includes even and odd partials, which is why it sounds fuller and brighter than the square at the same fundamental.
The arithmetic behind the partial levels
Harmonic levels are plain decibel arithmetic on the amplitude law. A 1/n series puts the second partial 20 × log10(2) = 6.0 dB below the fundamental, the fourth at 12.0 dB below, and the eighth at 18.1 dB below. A 1/n² law doubles every one of those figures: h2 sits 12.0 dB down, h4 sits 24.1 dB down and h8 sits 36.1 dB down, which is why a triangle has so little top end.
The fundamental also carries a fixed share of each classic wave’s peak amplitude. In a unit square the fundamental component is 4/π ≈ 1.27 times the wave’s peak, a triangle’s fundamental is 8/π² ≈ 0.81 of its peak, and a sawtooth’s fundamental is 2/π ≈ 0.64 of its peak. Those ratios are why the waveforms look so different on the canvas even when the fundamental is unchanged: the ear tracks the fundamental, but the visible shape is the sum.
Band limiting and the 16-partial rack
The rack holds 16 partials, and the Web Audio engine builds a band-limited wavetable from the coefficient array, so partials at or above the Nyquist frequency are left out rather than folded back as aliasing. At the 48 kHz sample rate most systems use, Nyquist is 24 kHz, which means all 16 partials fit under a fundamental of about 1.4 kHz. Push the fundamental toward the 2000 Hz maximum of the number box and the top of the rack starts dropping away: at 2 kHz, only partials below h12 still exist under a 24 kHz Nyquist. That is expected behavior, not a broken slider, and it keeps the output clean.
Accuracy, limits and troubleshooting
- Slot zero is not on the rack. The coefficient array carries a DC slot held at zero, so the 16 sliders are h1 to h16 with no offset control.
- Two frequency controls, one value. The slider stops at 1000 Hz while the number box accepts up to 2000 Hz. Use the number box if you need the wider range.
- High fundamentals thin out. As described above, partials above Nyquist are discarded, so a 1800 Hz sawtooth carries less upper-harmonic energy than a 220 Hz one.
- Randomize is random. Every press produces a different decaying series, and the result is not saved anywhere; note the slider positions if you want to reproduce a sound.
- The canvas shows the engine output. The live trace is drawn from the audio graph, so distortion added later by a small speaker or a clipped amplifier will not appear on screen; it will only be audible.
- Speaker limits shape what you hear. The 55 Hz chip is inaudible on most laptop and phone speakers, and a high-level sawtooth can overdrive small drivers. Use headphones for low fundamentals and keep the output volume sensible.
- No keyboard or MIDI input. This is a single-tone timbre lab, not a playable synth; the Tone Generator page covers simpler fixed-wave playback with a pitch dial.
Related tools
- Tone Generator: fixed sine, square, triangle and sawtooth waves with a frequency dial, dual tones and WAV export.
- Audio Oscilloscope: view the time-domain shape of any signal with a live trace and a text readout.
- Total Harmonic Distortion Test: measure the harmonic content your playback chain adds to a pure tone.
- Learn: tone generator waveforms explained: background on harmonic series, spectra and why waveforms look the way they do.
Frequently asked questions
What is an additive synthesizer online?
An additive synthesizer builds a sound by summing sine waves — the fundamental plus its harmonics. This free online additive synthesizer lets you set the amplitude of 16 partials, play the result through a band-limited wavetable, and watch the waveform update live, all in your browser with nothing to install.
What is Fourier additive synthesis?
Fourier's theorem proves that any periodic waveform can be deconstructed into a sum of simple sinusoidal waves (sine and cosine), each oscillating at integer multiples (harmonics) of a fundamental frequency. By adjusting the amplitude of each harmonic partial, you can sculpt any timbre from scratch.
What makes a square wave sound buzzy compared to a sine wave?
A pure sine wave contains only a single frequency—the fundamental (1f). A square wave contains the fundamental plus every odd harmonic (3f, 5f, 7f, 9f...) decaying inversely with frequency (1/n). Those high-frequency odd harmonics create the sharp, buzzy edge that characterizes square waves.
Why do instrument timbres differ if they play the exact same pitch?
When a violin, trumpet, and flute all play Middle C (261.63 Hz), they share the exact same fundamental pitch. What makes them sound distinct is their harmonic spectrum: the relative volume balance of the 2nd, 3rd, 4th, and higher overtones, along with transient attack times.
How does the Web Audio PeriodicWave API work?
The browser's Web Audio API compiles the array of real and imaginary Fourier coefficients into an internal band-limited wavetable. This ensures that even when you play high pitches with dozens of harmonics, the audio does not suffer from digital aliasing distortion.