Musical Intervals Simulator: Consonance, Dissonance & Tuning Systems

simulator intermediate ~12 min
Loading simulation...
Perfect fifth (3:2 = 660 Hz) — consonance score 0.8

A perfect fifth at ratio 3:2 produces a 660 Hz note above the 440 Hz base. This is one of the most consonant intervals, with a smooth combined waveform that repeats every 2 cycles of the higher note.

Formula

cents = 1200 * log₂(f₂ / f₁)
Equal temperament: f_n = f₀ * 2^(n/12)
Consonance ~ 1 / (p + q) for ratio p:q in lowest terms

The Mathematics of Musical Harmony

The connection between mathematics and music runs deeper than any other art form. Pythagoras discovered that harmonious intervals correspond to simple whole-number frequency ratios: the octave is 2:1, the perfect fifth is 3:2, the perfect fourth is 4:3. This discovery — that beauty has mathematical structure — has fascinated thinkers for over 2,500 years and remains one of the most profound connections between science and art.

Consonance and the Simplicity of Ratios

When two notes with a simple frequency ratio sound together, their combined waveform repeats at a regular period, and the ear perceives smoothness. A 3:2 ratio means the waveform repeats every 2 cycles of the higher note and 3 of the lower. Complex ratios like 45:32 (tritone) create waveforms that take many cycles to repeat, producing the tension and restlessness that characterizes dissonance. This simulation visualizes these interference patterns directly.

Tuning Systems and the Compromise

A fundamental problem in music theory: you cannot have all intervals be simultaneously pure. Stacking 12 perfect fifths (3:2) does not exactly equal 7 octaves — it overshoots by the Pythagorean comma (23.46 cents). Tuning systems represent different compromises. Just intonation keeps key intervals pure but limits modulation. Equal temperament distributes the comma equally among 12 semitones, making every key equally slightly impure but enabling free modulation.

Visualizing Interval Quality

The combined waveform of two notes reveals their harmonic relationship at a glance. Consonant intervals produce organized, periodic patterns. Dissonant intervals produce chaotic, aperiodic patterns. The boundary between consonance and dissonance is not sharp — it's a gradient that depends on context, culture, and musical training. But the physics of wave interference provides the foundation upon which musical aesthetics are built.

FAQ

What makes an interval consonant or dissonant?

Consonance correlates with simple frequency ratios. The octave (2:1), perfect fifth (3:2), and perfect fourth (4:3) are the most consonant intervals because their combined waveforms repeat quickly. Complex ratios like the tritone (45:32) create irregular beating patterns perceived as dissonance.

What is just intonation vs equal temperament?

Just intonation uses exact simple ratios (3:2 for a fifth, 5:4 for a major third) and sounds pure but only works well in one key. Equal temperament divides the octave into 12 equal semitones of 100 cents each, allowing modulation between keys but making every interval slightly impure.

What are cents in music?

A cent is 1/100th of an equal-tempered semitone, or 1/1200th of an octave. It's used to measure small pitch differences. The formula is cents = 1200 * log2(f2/f1). A just perfect fifth (3:2) is 702 cents, while an equal-tempered fifth is exactly 700 cents.

What is Pythagorean tuning?

Pythagorean tuning builds all intervals from stacked perfect fifths (3:2 ratio). This produces pure fifths and fourths but makes thirds harsh (81:64 instead of 5:4). It was the dominant tuning system in Western music until the Renaissance.

Sources

Embed

<iframe src="https://homo-deus.com/lab/sound-music/musical-intervals/embed" width="100%" height="400" frameborder="0"></iframe>
View source on GitHub