Music and mathematics
analyzes the pitch, timing, and structure of music. It uses mathematics to study elements of music such as tempo, chord progression, form, and meter. The attempt to structure and communicate new ways of composing and hearing music has led to musical applications of set theory, abstract algebra and number theory.
While music theory has no axiomatic foundation in modern mathematics, the basis of musical sound can be described mathematically and exhibits "a remarkable array of number properties".
History
Though ancient Chinese, Indians, Egyptians and Mesopotamians are known to have studied the mathematical principles of sound, the Pythagoreans of ancient Greece were the first researchers known to have investigated the expression of musical scales in terms of numerical ratios, particularly the ratios of small integers. Their central doctrine was that "all nature consists of harmony arising out of numbers".From the time of Plato, harmony was considered a fundamental branch of physics, now known as musical acoustics. Early Indian and Chinese theorists show similar approaches: all sought to show that the mathematical laws of harmonics and rhythms were fundamental not only to our understanding of the world but to human well-being. Confucius, like Pythagoras, regarded the small numbers 1, 2, 3, and 4 as the source of all perfection.
Time, rhythm, and meter
Without the boundaries of rhythmic structure – a fundamental equal and regular arrangement of pulse repetition, accent, phrase and duration – music would not be possible. Modern musical use of terms like meter and measure also reflects the historical importance of music, along with astronomy, in the development of counting, arithmetic and the exact measurement of time and periodicity that is fundamental to physics.The elements of musical form often build strict proportions or hypermetric structures.
Musical form
Musical form is the plan by which a short piece of music is extended. The term "plan" is also used in architecture, to which musical form is often compared. Like the architect, the composer must take into account the function for which the work is intended and the means available, practicing economy and making use of repetition and order. The common types of form known as binary and ternary once again demonstrate the importance of small integral values to the intelligibility and appeal of music.Frequency and harmony
A musical scale is a discrete set of pitches used in making or describing music. The most important scale in the Western tradition is the diatonic scale but many others have been used and proposed in various historical eras and parts of the world. Each pitch corresponds to a particular frequency, expressed in hertz, sometimes referred to as cycles per second. A scale has an interval of repetition, normally the octave. The octave of any pitch refers to a frequency exactly twice that of the given pitch.Succeeding superoctaves are pitches found at frequencies four, eight, sixteen times, and so on, of the fundamental frequency. Pitches at frequencies of half, a quarter, an eighth and so on of the fundamental are called suboctaves. There is no case in musical harmony where, if a given pitch be considered accordant, that its octaves are considered otherwise. Therefore, any note and its octaves will generally be found similarly named in musical systems.
When expressed as a frequency bandwidth an octave A2–A3 spans from 110 Hz to 220 Hz. The next octave will span from 220 Hz to 440 Hz. The third octave spans from 440 Hz to 880 Hz and so on. Each successive octave spans twice the frequency range of the previous octave.
Image:4Octaves.and.Frequencies.svg|thumb|upright=2.2|left|The exponential nature of octaves when measured on a linear frequency scale.
Image:4Octaves.and.Frequencies.Ears.svg|thumb|upright=2.2|left|This diagram presents octaves as they appear in the sense of musical intervals, equally spaced.
Because we are often interested in the relations or ratios between the pitches rather than the precise pitches themselves in describing a scale, it is usual to refer to all the scale pitches in terms of their ratio from a particular pitch, which is given the value of one, generally a note which functions as the tonic of the scale. For interval size comparison, cents are often used.
File:Middle_C,_or_262_hertz,_on_a_virtual_oscilloscope.png|thumb|Oscillogram of middle C.
Tuning systems
There are two main families of tuning systems: equal temperament and just tuning. Equal temperament scales are built by dividing an octave into intervals which are equal on a logarithmic scale, which results in perfectly evenly divided scales, but with ratios of frequencies which are irrational numbers. Just scales are built by multiplying frequencies by rational numbers, which results in simple ratios between frequencies, but with scale divisions that are uneven.One major difference between equal temperament tunings and just tunings is differences in acoustical beat when two notes are sounded together, which affects the subjective experience of consonance and dissonance. Both of these systems, and the vast majority of music in general, have scales that repeat on the interval of every octave, which is defined as frequency ratio of 2:1. In other words, every time the frequency is doubled, the given scale repeats.
Below are Ogg Vorbis files demonstrating the difference between just intonation and equal temperament. You might need to play the samples several times before you can detect the difference.
- Two sine waves played consecutively – this sample has half-step at 550 Hz, followed by a half-step at 554.37 Hz.
- Same two notes, set against an A440 pedal – this sample consists of a "dyad". The lower note is a constant A, the upper note is a C in the equal-tempered scale for the first 1", and a C in the just intonation scale for the last 1". Phase differences make it easier to detect the transition than in the previous sample.
Just tunings
American composer Terry Riley also made use of the inverted form of it in his "Harp of New Albion". Just intonation gives superior results when there is little or no chord progression: voices and other instruments gravitate to just intonation whenever possible. However, it gives two different whole tone intervals because a fixed tuned instrument, such as a piano, cannot change key. To calculate the frequency of a note in a scale given in terms of ratios, the frequency ratio is multiplied by the tonic frequency. For instance, with a tonic of A4, the frequency is 440 Hz, and a justly tuned fifth above it is simply 440× = 660 Hz.
| Semitone | Ratio | Interval | Natural | Half Step |
| 0 | 1:1 | unison | 480 | 0 |
| 1 | 16:15 | semitone | 512 | 16:15 |
| 2 | 9:8 | major second | 540 | 135:128 |
| 3 | 6:5 | minor third | 576 | 16:15 |
| 4 | 5:4 | major third | 600 | 25:24 |
| 5 | 4:3 | perfect fourth | 640 | 16:15 |
| 6 | 45:32 | diatonic tritone | 675 | 135:128 |
| 7 | 3:2 | perfect fifth | 720 | 16:15 |
| 8 | 8:5 | minor sixth | 768 | 16:15 |
| 9 | 5:3 | major sixth | 800 | 25:24 |
| 10 | 9:5 | minor seventh | 864 | 27:25 |
| 11 | 15:8 | major seventh | 900 | 25:24 |
| 12 | 2:1 | octave | 960 | 16:15 |
Pythagorean tuning is tuning based only on the perfect consonances, the octave, perfect fifth, and perfect fourth. Thus the major third is considered not a third but a ditone, literally "two tones", and is 2 = 81:64, rather than the independent and harmonic just 5:4 = 80:64 directly below. A whole tone is a secondary interval, being derived from two perfect fifths minus an octave, 2/2 = 9:8.
The just major third, 5:4 and minor third, 6:5, are a syntonic comma, 81:80, apart from their Pythagorean equivalents 81:64 and 32:27 respectively. According to Carl, "the dependent third conforms to the Pythagorean, the independent third to the harmonic tuning of intervals."
Western common practice music usually cannot be played in just intonation but requires a systematically tempered scale. The tempering can involve either the irregularities of well temperament or be constructed as a regular temperament, either some form of equal temperament or some other regular meantone, but in all cases will involve the fundamental features of meantone temperament. For example, the root of chord ii, if tuned to a fifth above the dominant, would be a major whole tone above the tonic. If tuned a just minor third below a just subdominant degree of 4:3, however, the interval from the tonic would equal a minor whole tone. Meantone temperament reduces the difference between 9:8 and 10:9. Their ratio, / = 81:80, is treated as a unison. The interval 81:80, called the syntonic comma or comma of Didymus, is the key comma of meantone temperament.