Constant spectrum melody


A constant timbre at a constant pitch is characterized by a spectrum.
Along a piece of music, the spectrum measured within a narrow time window varies with the melody and the possible effects of instruments.
Therefore, it may seem paradoxical that a constant spectrum can be perceived as a melody rather than a stamp.
The paradox is that the ear is not an abstract spectrograph: it "calculates" the Fourier transform of the sound signal in a narrow time window, but the slower variations are seen as temporal evolution and not as pitch.
However, the example of paradoxical melody above contains no infrasound.
The second paradox is that when two pitches are very close, they create a beat. If the period of this beat is longer than the integration window, it is seen as a sinusoidal variation in the average rating: sin + sin = sincos, where 1/ε is the slow period.
The present spectrum is made of multiple frequencies beating together, resulting in a superimposition of various pitches fading in and out at different moments and pace, thus forming the melody.

MATLAB/Scilab/Octave code

Here is the program used to generate the paradoxical melody:
n=10; length=20; harmon=10; df=0.1;
t=/44100;
y=0;
for i = 0:n,
for j = 1:harmon,
y=y+sin;
end;
end;
sound;