Pitching and Time-Stretching Samples
Here, you'll understand what happens when you change the pitch or the tempo of a sample, why the two are linked, and how to separate them without damaging the sound.
You've found a perfect guitar loop, but it's in E minor at 85 BPM, and your track is at 95. Or you want a vocal to go up a whole tone without sounding like a cartoon character. Either way, you're going to touch the pitch and the speed of a recording. This lesson explains the link between the two, with the few numbers that will save you from trial and error.
Faster means higher
Think of a vinyl record or a cassette. If you play them faster, the music speeds up and gets higher at the same time. The reason is simple: all the recorded vibrations go by faster, so all the frequencies go up. Double the speed, and every frequency doubles: everything goes up an octave, and the loop lasts half as long. Slow it down by half, and everything drops an octave while lasting twice as long.
DAWs call this way of doing things repitch: you change the playback speed, and the pitch follows. Listen to a short original pattern, then the same pattern played twice as fast.
The pattern goes up an octave and lasts half as long. In the piano roll, it looks like the next figure: the copy played at double speed fits in half a bar, twelve rows higher.
A semitone is about 6 percent of speed
Between the octave and nothing at all, there are all the semitones. Since the octave doubles the frequency in twelve equal semitones, each semitone multiplies the frequency, and so the speed, by about 1.0595. Going up one semitone means speeding up by roughly 6 percent; going up two semitones means speeding up by about 12 percent.
| Transposition | Speed ratio | A loop at 100 BPM becomes |
|---|---|---|
| +1 semitone | 1.0595 | 105.9 BPM |
| +2 semitones | 1.1225 | 112.2 BPM |
| +3 semitones | 1.1892 | 118.9 BPM |
| +5 semitones | 1.3348 | 133.5 BPM |
| +7 semitones | 1.4983 | 149.8 BPM |
| +12 semitones, one octave | 2 | 200 BPM |
| −1 semitone | 0.9439 | 94.4 BPM |
| −2 semitones | 0.8909 | 89.1 BPM |
| −12 semitones, one octave | 0.5 | 50 BPM |
This table tells you something important: with repitch, pitch and tempo are tied to each other. If you want to take a loop from 90 to 100 BPM, you need to speed it up by a ratio of about 1.111, which raises the pitch by about 1.82 semitones. The loop then falls between two notes, 18 cents short of a whole tone: it's no longer in any key your DAW knows.
From pitch to tempo
With repitch, shifting by +2 semitones multiplies the playback speed by 1.1225. A loop at 90 BPM therefore moves to 101.02 BPM, and its 4 bars last 9.5 seconds instead of 10.67.
A short phrase stands in for the sample. Repitch: pitch and tempo change together, like a sped-up record. Time-stretch: only the tempo changes. Pitch-shift: only the note changes.
From tempo to pitch
Going from 90 to 95 BPM with repitch raises the sample by 0.94 semitones. That is not a whole number of semitones: the sample will sound out of tune with the rest. Stick with time-stretch, or choose 95.35 BPM, which gives exactly +1 semitone.
Repitch, time-stretch and formants
With repitch, your DAW plays the sample faster or slower, like speeding up a record: pitch and tempo change together. Going up one half step multiplies the speed by about 1.0595, and going up an octave, which is 12 half steps, doubles it exactly.
Time-stretch, on the other hand, changes the length without touching the pitch, and its opposite, pitch-shifting, changes the pitch without touching the length. Both slice the sound into tiny pieces. Pushed too far, it leaves artifacts: soft transients, a metallic or grainy sound.
Formants are the resonances that give a voice or an instrument its character. With repitch, they move with the note: a voice pitched up sounds like a cartoon character, a voice pitched down sounds huge. Formant-preserving algorithms change the note while keeping that character.
Time-stretching separates pitch and tempo
Fortunately, your DAW can also do things differently. Time-stretching changes the length of a sound without changing its pitch. It cuts the recording into tiny pieces, then repeats them or squeezes them together to make the whole thing longer or shorter, without changing the playback speed of each piece. The reverse operation exists too: pitch-shifting changes the pitch without touching the length.
These buttons imitate a perfect result. In reality, every process leaves traces, called artifacts: drum attacks that smear, a slightly metallic or grainy sound, a strange echo on vocals. The bigger the change, the more you hear these traces. Changing the tempo by a few percent usually goes unnoticed; halving the tempo can almost always be heard.
Formants, or why a voice changes size
Raise a vocal a few semitones with repitch, and it no longer sounds like the same person singing higher: it seems smaller, younger, almost comical. Lower it, and it becomes huge, like a giant's. It isn't just the note that moved; the formants moved too.
Formants are frequency zones that the shape of the throat, mouth and nose reinforces, whatever note is being sung. They give each vowel and each voice its color. When someone sings higher, their formants stay roughly in the same place; only the fundamental and its harmonics go up. Repitch, on the other hand, moves everything, formants included, as if the throat were shrinking.
That's why many pitch-shifting tools offer to preserve the formants, or to move them separately. Preserve them so a vocal can change notes without changing character. Move them deliberately when you're after an effect: a high, strange vocal for a hook, or a deep, dark vocal for a menacing section.
Choosing between repitch and time-stretching
In practice, ask yourself two questions. Do you want to change the key, the tempo, or both? And if you're changing both, does the change land on a whole number of semitones? To change only the key, use pitch-shifting, choosing the shortest path: to go from G minor to A minor, go up two semitones rather than down ten. To change only the tempo, use time-stretching.
To change both, first work out the tempo ratio. When it lands almost exactly on a whole number of semitones, repitch is often the best solution, because it creates none of the artifacts of time-stretching: the sound isn't chopped up, it's just played faster. Many producers also like the color it gives drums, tighter when you speed up, heavier when you slow down.
Your loop is in E minor at 85 BPM, and your project is at 95 BPM. Work out how far the pitch would go up if you brought the loop to 95 BPM with repitch. Which key would it land in? What do you do next?
In the next lesson, we're going to detune sounds on purpose, by just a few cents, to understand what makes a synth sound wide.