User Rating 0.0
Total Usage 0 times
Drag to rotate
ADSR Envelope
Sequence Timeline 0 steps
Is this tool helpful?

Your feedback helps us improve.

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.

waveform generator 3d visualization audio synthesis sound design waveform sequence additive synthesis ADSR envelope WAV export

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 φ:

y(t) = A E(t) Nk=1 wk sin(2π k f t + φ)

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.

E(t) =
{
ttA if t < tAS + (1 S) e(t tA) / τD if tA t < tholdS e(t thold) / τR if t thold

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):

x= x cosθ z sinθ
y= y cosψ + (x sinθ + z cosθ) sinψ

Reference Data

WaveformHarmonic SeriesSpectral RolloffCrest FactorCommon Use
SineFundamental only−∞ dB/oct1.414 (3 dB)Test tones, sub-bass
SquareOdd harmonics (1, 3, 5…)−6 dB/oct1.0 (0 dB)Pulse width modulation, retro synths
TriangleOdd harmonics (1, 3, 5…)−12 dB/oct1.155 (1.25 dB)Soft leads, flutes
SawtoothAll harmonics (1, 2, 3…)−6 dB/oct1.155 (1.25 dB)Strings, brass, pads
CustomUser-definedVariableVariableExperimental, wavetable
Standard Musical Frequencies (A4 = 440 Hz, Equal Temperament)
C4261.63 Hz
D4293.66 Hz
E4329.63 Hz
F4349.23 Hz
G4392.00 Hz
A4440.00 Hz
B4493.88 Hz
C5523.25 Hz
ADSR Typical Ranges
ParameterMinTypicalMaxEffect
Attack1 ms10 - 100 ms5000 msFade-in speed
Decay1 ms50 - 300 ms5000 msInitial transient fall
Sustain00.5 - 0.81.0Held amplitude level
Release1 ms100 - 500 ms10000 msFade-out after note end
Harmonic Weighting Schemes
Equalak = 1
Inverse (Natural)ak = 1k
Inverse Squareak = 1k2
Exponential Decayak = e0.5k

Frequently Asked Questions

Each harmonic adds a sinusoidal partial at k × f Hz. When k × f exceeds half the sample rate (22050 Hz at 44100 Hz sample rate), aliasing occurs - the harmonic folds back into the audible spectrum as a phantom frequency. The generator automatically clamps harmonics so no partial exceeds the Nyquist limit. For a 440 Hz fundamental, the maximum useful harmonic count is floor(22050 / 440) = 50. Setting harmonics higher than this has no audible effect and is silently capped.
Clicks are caused by discontinuities in the waveform amplitude at step boundaries. If a step ends at a non-zero amplitude and the next step starts at a different value, the instantaneous jump creates a broadband transient. Use release times of at least 5-10 ms to fade out each step, and set attack times above 5 ms on the following step. The ADSR envelope is specifically designed to prevent this. Setting sustain to 0 with a short decay also eliminates the held portion entirely.
Inverse weighting (1/k) produces the natural harmonic series of a sawtooth wave, with a spectral rolloff of −6 dB per octave. This sounds bright and buzzy. Inverse-square weighting (1/k²) rolls off at −12 dB per octave, matching a triangle wave's spectrum. It sounds much darker and more flute-like. Equal weighting produces all harmonics at the same amplitude, which sounds harsh and is rarely found in natural instruments but useful for additive synthesis experimentation.
Yes, but be aware that WAV files are uncompressed PCM. A 44100 Hz, 16-bit mono signal produces approximately 86 KB per second. A 60-second sequence generates ~5.2 MB. The generator renders audio in-memory using an OfflineAudioContext, so very long sequences (>5 minutes) may cause browser memory pressure on devices with less than 2 GB available RAM. For long sequences, consider exporting individual steps separately.
Each step in the sequence is assigned a Z-coordinate proportional to its index. Step 0 sits at z = 0 (front), step 1 at z = spacing, and so on. The waveform for each step is computed over one full period and rendered as a ribbon of connected line segments at that Z-depth. Rotating the view with yaw (θ) and pitch (ψ) reveals phase relationships and amplitude differences between steps. The depth spacing is normalized so all steps fit within the visible frustum regardless of sequence length.
Phase offset (φ) shifts the starting point of every harmonic partial by the same angle in radians. For a single isolated tone, phase is inaudible to human ears - this is a well-established psychoacoustic principle. However, when multiple steps overlap during crossfade, or when two steps at the same frequency are concatenated, phase discontinuities become audible as clicks or comb-filtering artifacts. The visualization accurately reflects phase, making it a useful diagnostic for identifying such issues before export.