A Shepard tone is a sound that appears to rise (or fall) indefinitely in pitch without ever actually getting higher. It works by stacking N sinusoids separated by octaves under a Gaussian (bell-curve) amplitude envelope centred in log-frequency space. As every partial rises, it fades out at the top and a new one fades in at the bottom — the sonic equivalent of a Penrose staircase.
f_k(t) = f₀(t) · 2^k
A_k = exp( −(log₂(f_k) − μ)² / (2σ²) )
x(t) = ∑ A_k · sin(2π ∫ f_k dt)
Hans Zimmer used a Shepard tone in the Batpod chase scene of The Dark Knight to create the feeling of relentless, never-peaking acceleration. The endless staircase theme in Super Mario 64 is another famous example — the music climbs forever, just like the stairs.
A Shepard tone is an auditory illusion created by superimposing a set of sinusoids separated by octaves, each weighted by a bell-shaped (Gaussian) amplitude envelope. As the base frequency slowly rises and wraps back an octave, the brain perceives continuous upward pitch motion that never ends.
Roger Shepard, a cognitive scientist at Stanford, introduced this illusion in his 1964 paper in the Journal of the Acoustical Society of America. He demonstrated how tonal chroma (pitch class) and tone height (absolute pitch) can be dissociated in perception.
Jean-Claude Risset extended Shepard's discrete steps into a continuous version called the Risset glissando. Instead of discrete frequency jumps, the glissando slides each sinusoid continuously, producing a seamless infinite sweep. This simulator implements the continuous Risset variant.
The Gaussian bell curve is centred in the logarithmic frequency spectrum. Sinusoids near the centre are loudest; those at the top fade out while simultaneously new ones fade in at the bottom. This crossfading makes the ear always hear dominant tones in the middle register, hiding the octave wrap and sustaining the perception of endless ascent.
With base frequency f(t) and N components, partial k has frequency f_k = f(t) · 2^k. Its amplitude is A_k = exp(-(log₂(f_k) - μ)² / (2σ²)) where μ is the Gaussian centre and σ controls bandwidth. Each frame f(t) is multiplied by a small factor and wrapped modulo one octave.
The auditory system separates pitch chroma (the note letter) from pitch height (register). The Shepard tone constantly raises chroma while the envelope keeps height perceptually constant. Because chroma cycles through the octave seamlessly, the brain extrapolates continuous ascent with no endpoint.
A Shepard scale consists of discrete semitone steps, each a separate Shepard tone. The Shepard tone itself is a single sustained chord of stacked octave sinusoids. The Risset glissando is the continuous-sweep generalisation — which this simulator implements.
Hans Zimmer used a rising Shepard tone in The Dark Knight Batpod chase. The Beatles' 'A Day in the Life' coda uses a similar stacking principle. Super Mario 64's endless staircase theme is perhaps the most famous video-game example.
Yes. By slowly decreasing the base frequency, the same Gaussian-envelope technique produces an endlessly descending pitch. Toggle the Direction button in the HUD to switch to descending mode.
Pitch chroma is the cyclical quality of a note (C, D, E, … repeating every octave) independent of register. Pitch height is the overall position in the spectrum. Shepard tones manipulate these independently: chroma ascends while height stays constant, exploiting the brain's tendency to track chroma when the two cues conflict.
This simulator renders a Shepard tone: a stack of sine oscillators, each exactly an octave apart, whose loudness is shaped by a Gaussian bell curve plotted in log₂-frequency space. As the base frequency glides upward and wraps modulo one octave, partials fade out at the top of the curve just as new ones fade in at the bottom — so the ear always hears the same middle register even though pitch chroma keeps climbing. The Web Audio API drives each partial through its own OscillatorNode and GainNode, summed live to the output.
Octave-spaced sine partials (f₀·2ᵏ) are drawn as a rotating pitch wheel, a scrolling spectrogram and a live amplitude bar chart. The Gaussian envelope curve slides across the bar panel, always keeping the loudest partial near the same log-frequency centre — the mechanism behind the endless-ascent illusion.
Press ▶ Play to start the oscillators. Speed (0.1×–4.0×) sets how fast the base frequency climbs; Partials N (3–12) adds or removes octave layers; Gaussian σ (0.5–3.0) widens or narrows the envelope; Base freq (55–440 Hz) sets the lowest partial; ↑/↓ Dir flips ascending/descending; ⟲ Reset silences everything.
Psychologist Roger Shepard devised this illusion in 1964 to show that pitch chroma (note name) and pitch height (register) can be perceived independently. Hans Zimmer used a rising Shepard tone to score the relentless Batpod chase in The Dark Knight.
By default eight (N = 8), each tuned an exact octave above the last: f₀, 2f₀, 4f₀ … up to 2⁷f₀. Dragging the Partials N slider changes this from 3 to 12 layers in real time, instantly rebuilding the oscillator bank.
σ sets the width of the bell-shaped envelope in log₂-frequency space that weights each partial's gain. A small σ (0.5) makes only one or two partials audible at once; a large σ (3.0) spreads loudness across nearly all of them, softening the illusion.
Each animation frame multiplies the base frequency by a small speed-dependent factor; once it reaches double its starting value it is halved again (and vice versa when descending). This modulo-one-octave wrap, hidden beneath the Gaussian fade, is what lets the pitch seem to climb without end.
Speed (0.1×–4.0×) sets how many octaves per second the base frequency sweeps through, while ↑/↓ Dir simply flips the sign of that sweep, switching between an endlessly ascending and an endlessly descending glissando without changing its rate.
Yes. The partial-amplitude bar chart shows each oscillator's current gain and frequency in hertz, and the pitch wheel plots each audible partial's chroma as a coloured dot, making it easy to track which frequencies dominate at any moment.