Waveform explorer
Same pitch, different shape
Compare a smooth sine with finite approximations of triangle, square and sawtooth waves.
Enable JavaScript for interactive controls and synthesized sound. Default model: sine approximation using at most 8 harmonics. Finite sums have rounded corners; they are not ideal discontinuous waves.
Default model values
| Component | Frequency | Peak amplitude | Phase |
|---|---|---|---|
| 1 | 220.00 Hz | 0.2263 | 0° |
Real musicians · original recordings
One note. Two instruments.
Which note has a sharper start? Listen closely to the first moment of each recording.
Nominal 440 Hz
Flute first, then Violin.
Choose instruments
About these two sounds
Flute
A real flute played without vibrato. Listen to the airy onset and the sustained tone.
Explore fluteViolin
A real violin bowed on the A string. Listen to the friction in the attack and the sustained upper components.
Explore violinPlay individual recordings
Flute · A4
B♭ clarinet · A4
Violin · A4
B♭ trumpet · A4
Piano · A4
Marimba · A4
Two-second excerpts, level-matched for comparison. Natural pitch differences are preserved.
Recording credits and preparation
Recordings by Lawrence Fritts and the University of Iowa Electronic Music Studios. View the collection and its reuse terms ↗
- Flute ↗
- Sonja Feig · April 2000 (day not listed) · mf (mezzo-forte)
- Flute.nonvib.mf.B3B4.aiff · Estimated pitch 442.1 Hz
- Excerpt 28.295011–30.295011 s of the source; 2.000 s duration. Mono source retained. 44,100 Hz, 16-bit PCM WAV; linear 3 ms onset and 30 ms ending fades. Constant gain +5.36 dB, targeting −23 dBFS RMS over active 20 ms frames within 30 dB of the loudest frame; −3 dBFS peak ceiling. Result: -23.00 dBFS active RMS, -14.54 dBFS peak. No pitch shifting, time stretching, equalisation or dynamic compression. Natural tuning variation is retained; equal RMS does not guarantee equal perceived loudness.
- B♭ clarinet ↗
- Christine Bellomy · 1998-08-03 · mf (mezzo-forte)
- BbClar.mf.C4B4.aiff · Estimated pitch 439.7 Hz
- Excerpt 46.864989–48.864989 s of the source; 2.000 s duration. Mono source retained. 44,100 Hz, 16-bit PCM WAV; linear 3 ms onset and 30 ms ending fades. Constant gain +2.45 dB, targeting −23 dBFS RMS over active 20 ms frames within 30 dB of the loudest frame; −3 dBFS peak ceiling. Result: -23.00 dBFS active RMS, -16.06 dBFS peak. No pitch shifting, time stretching, equalisation or dynamic compression. Natural tuning variation is retained; equal RMS does not guarantee equal perceived loudness.
- Violin ↗
- Josue Jean-Francois · Not listed · mf (mezzo-forte)
- Violin.arco.mf.sulA.A4B4.aiff · Estimated pitch 437.7 Hz
- Excerpt 2.524989–4.524989 s of the source; 2.000 s duration. Mono source retained. 44,100 Hz, 16-bit PCM WAV; linear 3 ms onset and 30 ms ending fades. Constant gain +12.74 dB, targeting −23 dBFS RMS over active 20 ms frames within 30 dB of the loudest frame; −3 dBFS peak ceiling. Result: -23.00 dBFS active RMS, -12.72 dBFS peak. No pitch shifting, time stretching, equalisation or dynamic compression. Natural tuning variation is retained; equal RMS does not guarantee equal perceived loudness.
- B♭ trumpet ↗
- Aren Van Houzen · 2003-05-16 · mf (mezzo-forte)
- Trumpet.novib.mf.C4B4.aiff · Estimated pitch 437.2 Hz
- Excerpt 78.435011–80.435011 s of the source; 2.000 s duration. Mono source retained. 44,100 Hz, 16-bit PCM WAV; linear 3 ms onset and 30 ms ending fades. Constant gain -7.24 dB, targeting −23 dBFS RMS over active 20 ms frames within 30 dB of the loudest frame; −3 dBFS peak ceiling. Result: -23.00 dBFS active RMS, -13.95 dBFS peak. No pitch shifting, time stretching, equalisation or dynamic compression. Natural tuning variation is retained; equal RMS does not guarantee equal perceived loudness.
- Piano ↗
- Evan Mazunik · 2001-11-05 and 2001-11-27 (individual take date not identified) · mf (mezzo-forte)
- Piano.mf.A4.aiff · Estimated pitch 441.1 Hz
- Excerpt 0.215011–2.215011 s of the source; 2.000 s duration. Stereo folded to mono with equal channel weights, (L + R) / √2, before level adjustment. 44,100 Hz, 16-bit PCM WAV; linear 3 ms onset and 30 ms ending fades. Constant gain +17.59 dB, targeting −23 dBFS RMS over active 20 ms frames within 30 dB of the loudest frame; −3 dBFS peak ceiling. Result: -23.00 dBFS active RMS, -6.20 dBFS peak. No pitch shifting, time stretching, equalisation or dynamic compression. Natural tuning variation is retained; equal RMS does not guarantee equal perceived loudness.
- Marimba ↗
- Andrew Thierauf · 2013-03-20 · mf (mezzo-forte)
- Marimba.yarn.mf.C4B4.aif · Estimated pitch 443.4 Hz
- Excerpt 34.174989–36.174989 s of the source; 2.000 s duration. Source audio header verified as 96,000 Hz, 24-bit stereo; converted to 44,100 Hz without changing playback pitch or speed. Stereo folded to mono with equal channel weights, (L + R) / √2, before level adjustment. 44,100 Hz, 16-bit PCM WAV; linear 3 ms onset and 30 ms ending fades. Constant gain -1.03 dB, targeting −23 dBFS RMS over active 20 ms frames within 30 dB of the loudest frame; −3 dBFS peak ceiling. Result: -23.00 dBFS active RMS, -12.55 dBFS peak. No pitch shifting, time stretching, equalisation or dynamic compression. Natural tuning variation is retained; equal RMS does not guarantee equal perceived loudness.
Listen with a purpose
Try this.
At 220 Hz, compare sine and square. Then compare triangle and square: both use odd harmonics, but their strengths fall at different rates.
What is happening?
Square approximations use odd harmonics with amplitudes proportional to 1/n. Triangle approximations use odd harmonics falling as 1/n², with alternating signs. Sawtooth approximations include every integer harmonic at 1/n. These formulas connect a shape to a distribution of energy.
The model & its limits
Only eight harmonics are synthesized. These are band-limited approximations, not ideal square or sawtooth signals. The plotted line is calculated from precisely the same components used by the audio engine.
The interactive model synthesizes sound locally. Audio begins only after you press a listening button. Stop ends every scheduled voice; leaving or hiding the page stops audio. The numerical table remains useful without listening.
Static waveforms and component spectra are calculated from the current model. During playback, the waveform (except calculated swell, envelope and sampling illustrations) and spectrum come from the same browser audio signal. FFT bins have finite resolution; bars in the static view represent exact model components. A/B uses the same master volume; perceptual loudness is not calibrated.
How real instruments use this
Subtractive synthesizer
Follow an oscillator through a filter and envelope. The lab compares finite harmonic recipes, leaving analog circuitry and changing filters outside the experiment.
Electric guitar
See why changing a signal’s shape can change its spectrum. The waveform comparison isolates that relationship without simulating a pickup or amplifier.
Sources & further reading
These sources support the explanations and model assumptions. Recording credits are listed in the listening panels and the source register.
- Web Audio API 1.1 — Editor’s Draft ↗W3C Web Audio Working Group · 2026-11-06 (work in progress)
- Web Audio API best practices ↗MDN contributors / Mozilla · Undated
- The basic sinusoid ↗Chris Donahue / Carnegie Mellon University · 2026
- Time and frequency ↗Chris Donahue / Carnegie Mellon University · 2026
- Additive synthesis ↗Chris Donahue / Carnegie Mellon University · 2026
- What is a sound spectrum? ↗Joe Wolfe / UNSW Music Acoustics · Undated
- Periodicity, period, and frequency ↗Chris Donahue / Carnegie Mellon University · 2026
- Amplitude and phase spectra ↗Chris Donahue / Carnegie Mellon University · 2026
- Basic waveform shapes ↗Chris Donahue / Carnegie Mellon University · 2026