You don't have to be a virtuoso to be familiar with the idea that music in major keys is happy, and music in minor keys is sad. But is one minor key sadder than another ? With today's music technology - synthesisers, samplers and sequencers - it's very easy to shift musical parts up or down in pitch with just a couple of mouse clicks. The pitch will have changed but, to modern ears, the music will remain the same: neither happier nor sadder.
This was not the case 250 years ago, when moving a tune up or down a semitone was not to be taken lightly. Harpsichords were tuned so that the intervals between certain pairs of notes (notably major thirds and fifths) sounded bright and strong, which meant that the twelve semitone steps within an octave were not equal - some were bigger than others.
There is a fundamental mathematical reason for this: the ear prefers the sound of a major third, for example, when the frequencies of the two notes are in the mathematically precise ratio of 5:4, or 1.25:1; and a fifth with the ratio 3:2, or 1.5:1. But dividing the scale into twelve exactly equal steps results in a major third and fifth where the ratios of frequencies are 1.26:1 and 1.498:1 respectively.
So tuning instruments involves a compromise; either all semitones are precisely equal, but none corresponds to a mathematically pure interval, or some semitones are larger than others to allow for mathematically pure-sounding intervals in certain keys. But if you choose the latter option - called "unequal temperament" - it means that the same piece of music played in one key can sound completely different (and in some cases very unpleasant) if played in another key.
Is this a bad thing ? It is if you're playing along with a singer who can't hit those high notes. Transposing the music down a semitone or two could completely change way it sounds. On the other hand, an unequal tuning endows different keys with their own distinct moods and characters.
One of the first lists of such key characteristics was drawn up by the French musician Charpentier around 1692. D major is said to be "joyful and militant", A major "joyful and pastoral", E flat minor "cruel and hard", F minor "gloomy and plaintive", E minor "effeminate and amorous", and so on.
Charpentier's list is notable in that the key signatures containing several sharps or flats are said to be horrible or frightful-sounding. This is characteristic of an unequal tuning in which some intervals sound particularly jarring, and some keys sound so harsh as to be rendered almost completely unusable. Today's acoustic and electronic instruments, on the other hand, are tuned using equal temperament, which makes them equally versatile in all keys - but at the expense of the different keys' musical characters.
The switch from unequal to equal temperament occurred gradually, and as composers began to explore the possibilities of unusual key changes equal temperament became increasingly necessary. It was the musical equivalent of adopting Microsoft Windows: not the most elegant solution by any means, but the most convenient on the grounds of compatibility.
But the transition was bitterly opposed by those convinced that it would destroy the emotional values associated with different keys. The Swiss philosopher Jean-Jacques Rousseau defended unequal tunings in a long and acrimonious battle with French composer Rameau, who was an early convert to the more "natural" and scientific approach of equal temperament.
"If one imagines that harmony would be purer [under equal temperament]," asked Rousseau in 1749, "would this compensate for what is lost on the side of expression?" For his part, Rameau was supported by the French mathematician d'Alembert, who wrote, "We are convinced that, according to the intention of nature, the scale should be perfectly the same in all the keys. The opposite view, says Monsieur Rameau, is a musician's prejudice." D'Alembert later assumed a more diplomatic compromise position and said it was up to individuals to decide between equal and unequal temperament for themselves.
By the mid-19th century, equal temperament had become the standard, and today only musicians specialising in authentic instruments and performance practices continue to use unequal tunings.
Fortunately, modern electronic instruments make it very easy to find out what Rousseau was going on about when he described B flat major as tragic, F major as majestic, and C minor as tender. Many electric pianos have temperament settings, and can be switched from equal temperament to one or more unequal tunings. With synthesisers, it's often just a matter of downloading a system exclusive (SysEx) patch from the Internet.
The tuning of an electronic keyboard can thus be changed instantly; a real piano or harpsichord, on the other hand, would take an hour or more to retune. This gives us the opportunity to compare different temperaments directly - loop a piece of music on a sequencer, and then try it out with different settings.
Computers are often blamed for encouraging the production of bland, repetitive, unemotional music. But if Rousseau and his friends were around today, they would applaud the Roland HP-3800 digital piano's choice of five unequal temperament tunings, and point their Web browsers at the Just Intonation Network homepage ( www.dnai.com/~jinetwk/index.html).
They would surely argue that, given the unprecedented ability to turn an equal-tempered instrument into a unequal-tempered one with little more than the click of a few buttons, today's musicians have a duty to explore a repository of musical expression that has been tragically and unjustly neglected.
Tom Standage (tomtom@pobox.com) is an occasional treble recorder player and the least musical member of his family. During the day he is deputy editor of the Daily Telegraph's technology section.