iconEuler Examples

Musical Pitch and Temperament

by R. Grothmann

This notebook tests pure versus equal tempered or approximated harmonics.

Create the time values for 4 seconds of sound.


Let 440 Hz be our basic frequency.


New listen to a 220 Hz sound.


The following is a pure fifth.


Now we add the lower octave and vary the fifth in pitch. First the pure quint.


Now the equal tempered fifth. The difference is small. But with sine curves the beat (oscillating amplitude) is audible.


Now a fifth which is too much off.


Here are the corresponding numbers

>3/2, 2^(7/12), 1.49

Difference in tones is measured in cents, where 100 cents is a halftone, and the scale is logarithmic.

Here is the error in cents. First the tempered fifth.


The error is -2 cents. The error for the 1.49 approximation is already -11 cents. This is too much to be OK.


The difference in frequency explains the oscillation, since

Temperament in Musical Pitch

Since the pure fifth has no beat, we can hear a beat with a following frequency of 4.4 Hz.

>f*(3/2-2^(7/12)), f*(3/2-1.49)

Repeat the same with the major third.

>playwave(s); // pure
>playwave(s); // tempered
>playwave(s); // way off
>5/4, 2^(4/12), 1.24