Music Theory and Mathematics

Music and mathematics share a profound connection, with numbers underpinning the structure of rhythms, pitches, and harmonies. From the frequencies of sound waves to the fractional divisions of time signatures, math shapes the essence of music. This MathMultiverse guide explores how mathematical principles govern music theory, with detailed examples, equations, and applications in tuning systems, synthesizers, and algorithmic composition, enhanced by interactive visualizations.

Frequencies and Pitch

Pitch is fundamentally mathematical, determined by the frequency of sound waves.

Frequency and Period

The frequency \( f \) (in Hertz) of a sound wave is the inverse of its period \( T \):

\[ f = \frac{1}{T} \]

Example: A wave with a period of 0.00383 seconds has \( f = \frac{1}{0.00383} \approx 261 \, \text{Hz} \) (middle C, C4).

Octaves

An octave corresponds to a doubling or halving of frequency:

\[ f_{\text{octave}} = 2^n \cdot f_0 \]

Where \( n \) is the number of octaves, and \( f_0 \) is the base frequency. Example: C4 (261 Hz) to C5 is \( 2 \cdot 261 \approx 522 \, \text{Hz} \).

Tuning Standard

The A440 standard sets A4 at 440 Hz, serving as a reference for tuning.

Frequency Doubling (Octaves)

Frequency doubles with each octave, creating harmonic relationships.

Rhythm and Time

Rhythm is governed by fractional divisions of time, structuring musical flow.

Time Signatures

A time signature like 4/4 indicates 4 beats per measure, each a quarter note:

\[ \text{Measure duration} = 4 \cdot \frac{1}{4} = 1 \, \text{whole note} \]

Subdivision

Eighth notes divide a quarter note into two equal parts:

\[ \text{Eighth note} = \frac{1}{2} \cdot \text{Quarter note} \]

Polyrhythms

Polyrhythms combine different rhythmic ratios, e.g., 3:2 (three beats against two):

\[ \text{Least common multiple of 3 and 2} = 6 \text{ beats for alignment} \]

Harmony and Scales

Harmony arises from frequency ratios, creating consonance and structure.

Intervals

A perfect fifth has a 3:2 frequency ratio:

\[ f_{\text{fifth}} = \frac{3}{2} \cdot f_{\text{root}} \]

Example: For C4 (261 Hz), the fifth (G4) is \( \frac{3}{2} \cdot 261 \approx 391.5 \, \text{Hz} \).

Chords

Major triads use the ratio 4:5:6 for root, major third, and fifth:

\[ \text{C major: } C:E:G = 4:5:6 \implies 264:330:396 \, \text{Hz} \]

Scales

Pythagorean tuning builds scales from 3:2 ratios, while equal temperament divides octaves into 12 equal parts:

\[ f_n = f_0 \cdot (2^{1/12})^n \]

Where \( n \) is the number of semitones from the root frequency \( f_0 \).

Examples

Let’s explore practical applications of math in music.

Frequency of a Perfect Fifth

Calculate G4 from C4 (261 Hz):

\[ f_G = \frac{3}{2} \cdot 261 \approx 391.5 \, \text{Hz} \]

Equal Temperament

Find the frequency of D4 (two semitones above C4 at 261 Hz):

\[ f_D = 261 \cdot (2^{1/12})^2 \approx 293.66 \, \text{Hz} \]

Polyrhythm Timing

For a 3:2 polyrhythm over a 1-second measure:

\[ \text{3 beats: } \frac{1}{3} \approx 0.333 \, \text{s}, \quad \text{2 beats: } \frac{1}{2} = 0.5 \, \text{s} \]

Equal Temperament Frequencies

Frequencies of a C major scale in equal temperament.

Applications

Mathematics enhances music across various domains.

Synthesizers

Synthesizers generate sound waves using mathematical functions:

\[ y(t) = A \sin(2\pi f t) \]

Where \( A \) is amplitude, \( f \) is frequency, and \( t \) is time.

Tuning Systems

Equal temperament divides octaves logarithmically for consistent intervals:

\[ f_n = f_0 \cdot 2^{n/12} \]

Algorithmic Composition

Algorithms use mathematical patterns to generate music, e.g., fractal-based melodies.

Acoustics

Room acoustics model sound wave reflections using wave equations:

\[ \nabla^2 p - \frac{1}{c^2} \frac{\partial^2 p}{\partial t^2} = 0 \]