Lesson 5 of 15

Interval Ratios

Intervals and Frequency Ratios

An interval is the distance between two notes measured in semitones.

In 12-TET, every interval has a precise frequency ratio:

ratio = 2^(semitones / 12)

Common Intervals

SemitonesNameRatio
0Unison1.0000
3Minor 3rd1.1892
4Major 3rd1.2599
7Perfect 5th1.4983
12Octave2.0000

The perfect fifth (7 semitones) has ratio ≈ 3/2, making it one of the most consonant intervals. Two notes a perfect fifth apart sound naturally "in tune" together.

From Ratio to Frequency

If the root is at frequency f, the note n semitones above is at:

f × intervalRatio(n)

Your Task

Implement intervalRatio(semitones) that returns the frequency ratio.

Run your code to hear A4 and its perfect fifth (E5) played together.

Web Audio API loading...
Loading...
Click "Run" to execute your code.