
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} A_{i}(t) sin (arg_{i}(t)), where 
arg_{i}(t) = ∫ 2π f_{i}(τ) dτ , and 
f_{i}(t) = lowestFrequency · 2^{(i – 1 + octaveShiftFraction + t/(12/frequencyChange_st)}, with 
A_{i}(t) = 10^{((Lmin + (Lmax – Lmin) (1 – cos 2πθi(t)) / 2) / 20)}, where, 
L_{max} = 0, L_{min} = 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·2^{numberOfComponents}. 
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 = (i1)/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"
endfor
© djmw, October 13, 2016