One of the commands that create a Sound.
To create a Sound that is a continuous variant of the sound sequences used by Shepard (1964) in his experiment about the circularity in judgments of relative pitch.
The tone consists of many sinusoidal components whose frequencies might increase exponentially in time. All frequencies are always at successive intervals of an octave and sounded simultaneously. Thus the frequency of each component above the lowest is at each moment in time exactly twice the frequency of the one just below. The amplitudes are large for the components of intermediate frequency only, and tapered off gradually to subthreshold levels for the components at the highest and lowest extremes of frequency.
For a rising tone complex, the Sound is generated according to the following specification:
|s(t) = ∑i=1..numberOfComponents Ai(t) sin (argi(t)), where|
|argi(t) = ∫ 2π fi(τ) dτ , and|
|fi(t) = lowestFrequency · 2(i – 1 + octaveShiftFraction + t/(12/frequencyChange_st), with|
|Ai(t) = 10((Lmin + (Lmax – Lmin) (1 – cos 2πθi(t)) / 2) / 20), where,|
|Lmax = 0, Lmin = 10–amplitudeRange/20, and,|
|θi(t) = 2π log2 (f(t) / lowestFrequency) / numberOfComponents.|
The maximum frequency that can be reached during a sweep by any single tone is:
|maximumFrequency = lowestFrequency·2numberOfComponents.|
A component that reaches the maximum frequency falls instantaneously to the lowest frequency and then starts rising again.
The absolute sound pressure level of the resulting sound will not be set, it is only guaranteed that the peak value is just below 1. You can always scale the intensity with the Scale Intensity... command.
The following script generates 12 static Shepard tone complexes, 1 semitone 'apart', with a cosine window to temper the abrupt start and finish.
fadeTime = 0.010
for i to 12
fraction = (i-1)/12
Create Sound as Shepard tone: "s" + string$ (i), 0, 0.1, 22050, 4.863, 10, 0, 34, fraction
Fade in: 0, 0, fadeTime, "no"
Fade out: 0, 0.1, -fadeTime, "no"
© djmw, October 13, 2016