Music Music Composition Simulation

Compose a 16-step melody and hear how scales, tuning and harmonics are built from frequency ratios.

Presets

Controls

Readouts

Independent check

...
The science

Pitch and tuning. Equal temperament divides the octave into 12 equal steps: f = f0 · 2n/12, with A4 = 440 Hz so C4 = 261.63 Hz. Just intonation uses small whole-number ratios (octave 2:1, fifth 3:2, major third 5:4, minor third 6:5), which make partials of two notes coincide so they sound smooth. The equal-tempered fifth is 700 cents, the just fifth 701.955 cents; the difference is the price of being able to play in every key.

Why ratios sound consonant. The Tenney height log2(n·d) of an interval n:d is a rough measure of its complexity: 3:2 gives 2.6 bits, 45:32 about 10.5. The page reports the mean over your melody's steps. It is a simple heuristic, not a full model of harmony or taste.

Timbre. Each note is a sum of harmonics, amplitude proportional to 1/np: a few harmonics sound soft, many sound bright and buzzy. Rhythm. A Euclidean rhythm E(k,16) spreads k pulses as evenly as possible over 16 steps (many traditional rhythms from around the world are of this form).

Honest limits: one voice, no chords, no dynamics or swing, a simple exponential note decay; real instruments also have inharmonic partials and noise. Sound needs a click or tap first (browser autoplay rule).