======================================================================
=                            Shepard tone                            =
======================================================================

                             Introduction
======================================================================
A Shepard tone, named after Roger Shepard, is a sound consisting of a
superposition of sine waves separated by octaves. When played with the
bass pitch of the tone moving upward or downward, it is referred to as
the 'Shepard scale'. This creates the auditory illusion of a tone that
continually ascends or descends in pitch, yet which ultimately seems
to get no higher or lower.


                             Construction
======================================================================
Each square in the figure indicates a tone, with any set of squares in
vertical alignment together making one Shepard tone. The color of each
square indicates the loudness of the note, with purple being the
quietest and green the loudest. Overlapping notes that play at the
same time are exactly one octave apart, and each scale fades in and
fades out so that hearing the beginning or end of any given scale is
impossible. As a conceptual example of an ascending Shepard scale, the
first tone could be an almost inaudible C4 (middle C) and a loud C5
(an octave higher). The next would be a slightly louder C4 and a
slightly quieter C5; the next would be a still louder D4 and a still
quieter D5. The two frequencies would be equally loud at the middle of
the octave (F4 and F5), and the twelfth tone would be a loud B4 and an
almost inaudible B5 with the addition of an almost inaudible B3. The
thirteenth tone would then be the same as the first, and the cycle
could continue indefinitely. (In other words, each tone consists of
two sine waves with frequencies separated by octaves; the intensity of
each is e.g. a raised cosine function of its separation in semitones
from a peak frequency, which in the above example would be B4.
According to Shepard, "(...) almost any smooth distribution that
tapers off to subthreshold levels at low and high frequencies would
have done as well as the cosine curve actually employed.")


The acoustical illusion can be constructed by creating a series of
overlapping ascending or descending scales. Similar to a barber's
pole, the basic concept is shown in Figure 1.

The scale as described, with discrete steps between each tone, is
known as the discrete Shepard scale. The illusion is more convincing
if there is a short time between successive notes (staccato or marcato
instead of legato or portamento).

Jean-Claude Risset subsequently created a version of the scale where
the tones glide continuously, and it is appropriately called the
continuous Risset scale or Shepard-Risset glissando. When done
correctly, the tone appears to rise (or fall) continuously in pitch,
yet return to its starting note. Risset has also created a similar
effect with rhythm in which tempo seems to increase or decrease
endlessly.


                           Tritone paradox
======================================================================
A sequentially played pair of Shepard tones separated by an interval
of a tritone (half an octave) produces the tritone paradox. Shepard
had predicted that the two tones would constitute a bistable figure,
the auditory equivalent of the Necker cube, that could be heard
ascending or descending, but never both at the same time.

In 1986, Diana Deutsch discovered the paradoxical auditory illusion
where scales may be heard as either descending or ascending. Deutsch
later found that perception of which tone was higher depended on the
absolute frequencies involved, and that different listeners may
perceive the same pattern as being either ascending or descending.


                               Examples
======================================================================
* In a film by Shepard and E. E. Zajac, a Shepard tone accompanies the
ascent of an analogous Penrose stair.
* In his book 'Gödel, Escher, Bach: An Eternal Golden Braid', Douglas
Hofstadter explains how Shepard scales can be used on the 'Canon a 2,
per tonos' in Bach's 'Musical Offering' (called the 'Endlessly Rising
Canon' by Hofstadter) for making the modulation end in the same pitch
instead of an octave higher.
* In 'Super Mario 64', a modified Shepard tone is incorporated into
the music of the endless staircase, the staircase to the penultimate
room in the castle. Much like a real Shepard tone, the staircase
itself gives players the impression that they are constantly running
upwards, when in reality the game has simply locked them in place, and
turning around reveals that they were actually running in place
halfway up the stairs.
* In the film 'The Dark Knight' and its follow-up 'The Dark Knight
Rises', a Shepard tone was used to create the sound of the Batpod, a
motorcycle that the filmmakers didn't want to change gear and tone
abruptly but to constantly accelerate.
* The Shepard tone was a key aspect in Stephin Merritt's song "Man of
a Million Faces", composed for NPR's "Project Song".
* The ending of the song "Echoes" from the album 'Meddle' by Pink
Floyd features a Shepard tone that fades out to a wind sound (actually
a white noise processed through a tape echo unit).
* The Austrian composer Georg Friedrich Haas uses a Shepard tone
effect towards the end of his orchestral piece 'in vain' (2000/02).
* The song "Slow Moving Trains" from Godspeed You! Black Emperor's