3D Waveform Sequence Generator
Generate, visualize in 3D, and export custom waveform sequences with additive synthesis, ADSR envelopes, and WAV audio download.
About
Waveform sequencing is the backbone of sound design, from synthesizer patches to scientific signal generation. Errors in frequency ratios, harmonic weighting, or envelope timing produce artifacts that cascade through downstream processing. This tool computes waveform samples using additive synthesis: a fundamental at frequency f plus n harmonics weighted by 1k, where k is the harmonic index. Each step in the sequence applies an independent ADSR envelope to shape amplitude over time. The 3D visualization stacks waveform ribbons along a depth axis so you can inspect phase alignment and spectral shape across the entire sequence at a glance.
The generator outputs 44100 Hz mono PCM audio encoded as a standard WAV file. It supports sine, square, triangle, sawtooth, and custom-drawn waveforms. Note: additive synthesis with high harmonic counts (>32) on square and sawtooth types may introduce Gibbs phenomenon ringing near discontinuities. For critical applications, consider applying a window function externally. Pro tip: keep attack times above 5 ms to avoid audible clicks at note onsets.
Formulas
Each sample in the waveform is computed via additive synthesis. The composite signal at time t for a step with fundamental frequency f, N harmonics, amplitude A, and phase offset φ:
Where E(t) is the ADSR envelope function and wk is the harmonic weight for the k-th partial. For square waves, only odd k values contribute. For triangle waves, odd k with alternating sign and inverse-square weighting. For sawtooth, all k with inverse weighting and alternating sign.
Where tA = attack time, τD = decay time constant, S = sustain level (0 - 1), τR = release time constant, and thold = total step duration minus release time.
The 3D projection maps each waveform ribbon from world coordinates (x, y, z) to screen coordinates using rotation angles θ (yaw) and ψ (pitch):
Reference Data
| Waveform | Harmonic Series | Spectral Rolloff | Crest Factor | Common Use |
|---|---|---|---|---|
| Sine | Fundamental only | −∞ dB/oct | 1.414 (3 dB) | Test tones, sub-bass |
| Square | Odd harmonics (1, 3, 5…) | −6 dB/oct | 1.0 (0 dB) | Pulse width modulation, retro synths |
| Triangle | Odd harmonics (1, 3, 5…) | −12 dB/oct | 1.155 (1.25 dB) | Soft leads, flutes |
| Sawtooth | All harmonics (1, 2, 3…) | −6 dB/oct | 1.155 (1.25 dB) | Strings, brass, pads |
| Custom | User-defined | Variable | Variable | Experimental, wavetable |
| Standard Musical Frequencies (A4 = 440 Hz, Equal Temperament) | ||||
| C4 | 261.63 Hz | |||
| D4 | 293.66 Hz | |||
| E4 | 329.63 Hz | |||
| F4 | 349.23 Hz | |||
| G4 | 392.00 Hz | |||
| A4 | 440.00 Hz | |||
| B4 | 493.88 Hz | |||
| C5 | 523.25 Hz | |||
| ADSR Typical Ranges | ||||
| Parameter | Min | Typical | Max | Effect |
| Attack | 1 ms | 10 - 100 ms | 5000 ms | Fade-in speed |
| Decay | 1 ms | 50 - 300 ms | 5000 ms | Initial transient fall |
| Sustain | 0 | 0.5 - 0.8 | 1.0 | Held amplitude level |
| Release | 1 ms | 100 - 500 ms | 10000 ms | Fade-out after note end |
| Harmonic Weighting Schemes | ||||
| Equal | ak = 1 | |||
| Inverse (Natural) | ak = 1k | |||
| Inverse Square | ak = 1k2 | |||
| Exponential Decay | ak = e−0.5k | |||