Musical Math Lab

number theory, polyrhythms & tuning comparison

Loading interactive simulation...

Acoustic Logarithmic Iso-Spaces 🖖

Musical harmony represents a profoundly elegant application of modular arithmetic and logarithmic perception. The twelve-tone equal temperament forces irrational exponential frequency roots into a mathematically imperfect but perceptually tolerable lattice, highlighting the computational compromises inherent in psychoacoustics.

How a number becomes a chord 🖖

Every whole number breaks into prime factors — its indivisible building blocks. This tool turns each prime into a musical interval: 2 is an octave, 3 a perfect fifth, 5 a major third. So the number 6 = 2 × 3 sounds as an octave with a fifth stacked on top, while a prime like 7 plays a single pure tone. You are literally hearing a number's arithmetic skeleton.

Rhythms born in a particle accelerator 🖖

The evenly spaced beat patterns here come from Bjorklund's algorithm, invented to time neutron pulses in a spallation neutron source at Los Alamos. In 2005 computer scientist Godfried Toussaint noticed its output matches folk rhythms worldwide — one default, E(5,8), is the Cuban cinquillo. Stranger still, the method is Euclid's more than 2000-year-old algorithm for the greatest common divisor, repurposed to space drum hits.

Example problems

  • Naturals - Natural numbers arpeggio: watch the prime factor mandala expand.
  • Fibonacci - Fibonacci ambient sequence: notes scale outwards matching spiral values.
  • Polyrhythm - Polyrhythm loop: a 5-beat and 7-beat Euclidean rhythm playing in parallel.
  • Tuning Compare - Tuning comparison: compare Just intonation (3:2) against Equal temperament (2^(7/12)).