♦ Why does a piano go out of tune?
The causes of piano detuning are due to their basic components:
• Tuning pins
• Cast iron plate
The detuning is directly related to:
• The material of the components mentioned
• Their age and state
• Environmental conditions
Wood is a material that is sensitive to climate changes and humidity, and it is the raw material of a piano. The biggest component of it, is the soundboard which is made of spruce, solid or laminated, and it behaves as a big membrane where all the strings are. The soundboard is slightly curved to resist the tension of the strings and to give a greater ressonance (the underside gets compressed and transmits better the sound). There are two more relevant components made of wood:
• The bridge which transmits the vibration from the strings to the soundboard
• The pinblock which holds the pins where the strings are knoted
In dry seasons the soundboard shrinks and its curvature decreases, so the bridge (which is on the soundboard) loses charge against the strings, and the strings lose tension. Then, the piano lowers pitch and it does in an irregular way.
In wet seasons the soundboard expands and increases its curvature, so the bridge gains charge, and increases the strings tension. Then, the piano raises pitch, and again it does in an irregular way.
The loss of tension in dry seasons is bigger than the gain in wet seasons, along the year a pitch drop is obtained (it goes out of tune too) which accumulates year after year.
Moisture attenuation systems can be installed inside the piano, they maintain the wood better, and they make piano tunings more stable. But there are some risks, for example: water condensation, that they might ocasionaly malfunction, or they break spilling water inside the piano, which is a real problem.
Another important reason why pianos go out of tune is the quality and state of conservation of the pinblock. The wood of the pinblock dries over the years, and the tuning pins lose subjection strength, further, the pins could rust and change a bit their shape. If the piano is built with high-quality and well-dried wood the lifetime of the instrument increases.
There are also other conditions that contribute to the untuning of the piano. The strings, pins and the plate are made of metal, they suffer dilatation and torque effects with temperature changes. Although it is a minor effect if we compare it to the moisture on wood, it also affects the tension that every tuning pin holds.
Obviously, a piano goes out of tune due to daily use. When the action hammers hit the strings, they leave their repose state making all the instrument vibrate, which includes the soundboard, the plate, the pinblock,…
Moving the piano, and playing the piano in an intense way or for many hours, also lead to untuning.
A piano in good shape goes out of tune and loses pitch gradually, around 1 Hz per year. If this descent accumulates the piano will need a pitch raise, when it is tuned again all the piano will have to adapt to the tension change of all the strings:
Each string has from 70 to 100 kilograms of tension (though the lower bass strings can have 200 kilograms), all together sum between 15 and 20 tons that must be held by the pinblock, plate and soundboard (also the strings press on the bridge and then on the soundboard over 360 kilograms). If the tension of all the strings is raised there is a very significant change in weight and the piano will need some days to adapt and distribute the tension, this leads to a detuning.
As the piano structure (cast iron plate and soundboard) have some elasticity, added to the elasticity of the strings and the torque of the tuning pins, when a pitch raise is done, the structure, strings and tuning pins move and modify string tensions while the tuning process is being carried out, also in the following days to tuning, making the tuning unestable and leading the piano to need another tuning.
The elastic deformation process of the piano structure, strings and tuning pins are not immediate. For this reason sometimes is not possible to raise the pitch and then tune the piano in the same day, it needs time to expand and get used to the tension applied in them.
Another risk in rasing the pitch of a piano is that one or various strings might brake. The grater the increase, and the older the piano, the more probabilities there are for it to happen.
There are pianos which need to be tuned regularly:
• Pianos that are played a lot, like the ones in music schools.
• Pianos with special requirements, like those in concert halls or recording studios.
• New pianos must be tuned during the first months because they lose pitch earlier, they are adapting to strings tensions and the humidity of the new house.
• Piano that are moved around must be tuned after 2 or 3 weeks of the translation, when the piano wood is adapted to the humidity of the new house.
• Pianos located in places with big humidity changes, and pianos located near air conditioning or radiators, with sun incidence or airflows, they go out of tune faster. So, it is important (as far as possible) to put the piano in a place with proper conditions: far from windows, better if they are far from house exterior walls, far from radiators and far from the air-conditiong and airflows. That will help our piano to stay tune for longer periods of time.
♦ Piano tuning theory and technique
Piano tuning is the adjustment of the tension in the strings, moving the tuning pins to set higher or lower frequencies, until it is obtained the correct sound of intervals and their harmonics. Normally, it starts with an A4 at 440Hz, or higher if it is required (for example: to play with wind instruments or orchestra, or to obtain a slightly brighter tone), or lower if the piano is antique and cannot endure such tension (although the best thing is to raise the pitch and tune in the standard frequencies).
There is a difference between electronic tuning and aural tuning, depending if we use a device to measure frequencies or if the tuning is based on our hearing for recognising intervals. The advantage of aural tuning is that the piano strings and their inharmonicity are taken into account, because every piano is different, with a different hammering on the strings, with different strings and different tensions, the ear lets us adapt to each piano and tune them correctly, and more precisely. It is also possible to combine aural tuning with electronic support.
The tuning pins are moved by a tool called tuning key (or tuning lever). It is recommended to use a long and rigid lever to have more control of the applied force. And it is better a star tip to have more positions to move it.
Pianos normally have 88 notes that have 1, 2 or 3 strings per key (treble piano wire and bass strings). Every key must sound as it only had 1 string, therefore it is important not only to tune but also to stabilize the strings, because strings lose their tension in an irregular way with time: due to tuning pin torque and the strings elasticity in the short-term, also temperature and moisture changes in the long-term (daily and seasonally).
Piano tuning is a balance of the intervals which allows to form chords that sound consonantly. The first to be tuned is the temperament (the 2 central octaves of the piano) and then the tuning is extended to the other octaves.
Now, the most used temperament is the ‘equal’ temperament. The just octave is divided in 1200 cents, where each semitone has 100 cents. This way, every note can form the same intervals.
But equal temperament doesn’t give exactly consonant intervals (though it is a good aproximation). For example, starting on an A4 at 440Hz, the just fifth is 660Hz, but an equal tempered fifth is 700 cents over 400Hz which results in 659.3Hz. The slight difference is enough to be heard, we notice beats between the tonic and the fifth. These beats are used to tune the piano.
There is a reason why it is not possible to tune just fifths for all the notes, and that’s why a piano is tuned with equal tempered fifths. If we do a cicle a just fifths, is is obtained an octave of 1224 cents and not one of 1200 cents.
So, there is an excess of 24 cents that are spread among all the fifth intervals to obtain a just octave. The excess cents can be distributed equally, or it is possible to privilege certain intervals or certain tonalities, that is called temperament. The goal when tuning is to minimize beats between notes, though, even in just intervals there are beats due to the harmonics of each note.
In the following image there are examples of how to distribute the -24 cents: it can be seen the pythagore’s tuning (just fifths), the equal temperament, the meantone tuning (just major thirds), and other historical temperaments:
Added to the temperament, there is another issue, piano string harmonics are slightly sharper than what they should be mathematically, that is called inharmonicity. Inharmonicity appears because the nodes (harmonics have nodes and valleys) aren’t a point. The vibrating string has quite a chaotic behaviour and it is in 3D, its nodes are like a cilinder in movement. So, the part of the string that makes the harmonic valley (or valleys) is shorter and produces higher frequencies, and the result is a sharper harmonic than its theoretical frequency. The higher the harmonic, more nodes it has, and greater is the inharmonicity.
Inharmonicity leads to extend the octave, the stretch, for all the piano but specially for treble and bass. In the following image you can see an example: in green the Railsback curve (Railsback was the first person to measure piano inharmonicities). Extreme piano strings have more inharmonicity because they are proportionally more thick to their respective length.   
The stretch also allows a more lasting tuning, because treble strings lose pitch faster than bass strings. The stretch also helps the temperament because there will be less excess of cents in the octave and allows tempered fifths to sound more consonant.
Both the temperament and the stretch can be programmed in electronic devices. Even so, in this field is where aural tuning ‘wins’, since every piano is different, every piano has different strings with different tension, with different hammers, which hit in a different way, with its imperfections, with a different finality (classical, jazz…), with different ressonances, even in the perception of frequencies of the human ear. Taking all that into account, there is a degree of subjectivety in tuning a piano, there isn’t only one correct formula for tuning and every piano tuner has his own way of doing it.
For detailed information (mathematical and historical) of the temperament and stretch you can consult this document.