Time stretch a sample that's at the wrong tempo for your track, and pitch shift one that's in the wrong key. When both are wrong and the sample has notes in it, do each one separately, because varispeed can only move them together.
On drum loops with no clear key, varispeed is often the cleanest choice for small tempo changes, since a few percent of extra pitch rarely matters and nothing gets cut up.
At a glance
| Property | Time stretching | Pitch shifting | Varispeed |
|---|---|---|---|
| Length and tempo | Change | Stay the same | Change |
| Notes and key | Stay the same | Change | Change |
| Formants of a voice | Stay where they were | Move with the notes, unless corrected | Move with the notes |
| On the spectrum | Same shape, same place | Whole shape slides sideways | Whole shape slides sideways |
| Typical artefacts | Doubled or smeared hits, warble | Chipmunk or giant voices, grainy buzz | None, apart from the change itself |
| Works on a live input | No, only on recorded audio | Yes, with a little latency | No, only on recorded audio |
| In a DAW | Changing the tempo of a warped clip | The clip's transpose control, or a pitch plug-in | Re-Pitch, Speed (FX) or Varispeed modes |
What is time stretching?
A time stretcher makes a sound last longer or shorter and keeps every note at its original pitch. Slow a 120 BPM loop to 90 BPM and it gets a third longer, but its bass line still plays the same notes and its chords stay in the same key. Many stretchers, including the one in this lab, cut the audio into short overlapping slices called grains, then lay those grains down further apart to make the sound longer, or closer together to make it shorter.
Each grain is a few tens of milliseconds of the original waveform played at its original speed, so the pitch inside every grain is untouched. Only the spacing changes. That's why the spectrum of a stretched loop sits right on top of the original's: the same frequencies are there in the same amounts, spread over a different length of time.
In a DAW you rarely see a stretch control by that name. You set a clip's original tempo, switch on Warp in Ableton Live, Flex Time in Logic Pro or Elastic Audio in Pro Tools, and then any change to the project tempo stretches the clip to follow.
What is pitch shifting?
A pitch shifter moves every note up or down and leaves the timing exactly where it was. Shift the same 120 BPM loop down 5 semitones and it's still 8 seconds long at 120 BPM, with every hit landing where it did, but A minor has become E minor, and an A at 110 Hz now sounds as an E at 82.4 Hz.
Every frequency is multiplied by the same ratio, so a note's fundamental and its harmonics move together and stay in proportion. Down 5 semitones the ratio is 0.749; up an octave it's exactly 2. On the lab's spectrum, which uses a logarithmic frequency scale like your hearing, that multiplication shows up as the whole shape sliding sideways by the same distance everywhere.
You'll find pitch shifting as the transpose control on an audio clip, as Flex Pitch in Logic Pro, and as plug-ins such as Soundtoys Little AlterBoy or Celemony Melodyne, which shifts each note separately.
What is varispeed?
On a tape machine or a record player, speed and pitch are one control. Play a tape or a record faster and every cycle of every wave arrives sooner, so the music gets higher and shorter at the same time. Each semitone is a speed change of about 5.95%, because twelve equal steps have to multiply up to 2, the ratio of an octave.
The lab makes the relationship easy to see. Step 2 stretches the mix to 75% speed with no change of pitch, step 3 shifts it down 5 semitones with no change of length, and step 4 does a varispeed drop of 5 semitones, which works out at 74.9% speed. The varispeed result is 10.68 seconds long at 89.9 BPM in E minor, within a hair of what you'd get by stretching to 75% and shifting down 5 semitones one after the other.
So time stretching and pitch shifting are what you get when you pull varispeed apart into its two halves. Varispeed itself is still the cleanest of the three, because it only reads the recording faster or slower and never cuts anything up. The pitch shifting and time stretching lesson goes through varispeed, grains and grain size in more detail.
Is pitch shifting just time stretching in disguise?
Often, yes. A common way to build a pitch shifter is to time stretch first and then use varispeed to put the length back. To go up 5 semitones, the shifter stretches the sound to 1.335 times its length at the same pitch, then plays the result 1.335 times faster. The speed-up raises the pitch 5 semitones and brings the length back to where it started. The lab works in exactly that order, and the transpose control on a warped clip uses the same warp engine as the stretch, which is why the warp mode changes how a transposed clip sounds as well as a stretched one.
The size of the hidden stretch depends on the size of the pitch shift, so a big shift costs as much as a big stretch.
| Pitch shift | Frequencies multiplied by | Stretch it needs first | Same stretch as taking a 120 BPM loop to |
|---|---|---|---|
| +1 semitone | 1.059 | 105.9% length | 113.3 BPM |
| +3 semitones | 1.189 | 118.9% length | 100.9 BPM |
| +7 semitones | 1.498 | 149.8% length | 80.1 BPM |
| +12 semitones | 2.000 | 200% length | 60 BPM |
| −5 semitones | 0.749 | 74.9% length | 160.2 BPM |
| −12 semitones | 0.500 | 50% length | 240 BPM |
Shifting a vocal up an octave asks the stretcher to double its length, which is as hard as slowing a loop to half speed. Shifting up a semitone is about as gentle as nudging a tempo from 120 to 113 BPM. When a transposed sample sounds rough, the cure is often a smaller transposition: to go from A minor to C minor, +3 semitones is a much smaller job than −9.
Not every pitch shifter works this way. Some process the sound in the frequency domain and move each band, and voice shifters built on PSOLA cut one grain per cycle of the note and respace the grains. The rule from the table still roughly holds for all of them: the further you move the pitch, the more of the sound the shifter has to make up.
Which is worse on drums?
Time stretching is. A drum hit is a transient, a sharp jump in level that lasts a few milliseconds, and a grain-based stretcher has no idea where it is. When you slow a loop down, grains are taken from closer together than they're laid down, so each hit ends up inside more than one grain. With long grains those copies are far enough apart to hear separately, and a single snare comes out as a flam.
Step 5 of the lab slows the drum loop to 60% speed, 72 BPM, with 100 ms grains. The lab counts 68 attacks in the stretched loop against 40 in the original, because many hits now play twice, about 50 ms apart. Turn the Grain knob down to 20 ms and the copies sit close enough to blur back into one hit, at the cost of a rougher tone on anything low and held. Drum modes such as Beats in Ableton Live and Slicing in Logic Pro get round the problem another way: they cut the audio at each hit and move the slices, so the hits themselves are never stretched.
Pitch shifting the same drums is much gentler. Step 6 keeps the 100 ms grains, puts the speed back to 100% and moves the pitch down 5 semitones. The hidden stretch inside that shift makes the loop shorter before slowing it back down, and shortening repeats far less material than lengthening does, so the lab counts 39 attacks against the original 40. Every hit lands where it did, only deeper. Shift up 5 semitones instead and the hidden stretch has to lengthen the loop, so a few hits start to double again.
If you want to tune drums down and don't mind them getting longer, varispeed avoids grains altogether. Classic hardware samplers such as the E-mu SP-1200 change a sample's pitch by changing how fast they play it back, so a kick tuned down also gets longer, and that longer, deeper kick is often the sound you were after.
Which is worse on vocals?
Pitch shifting, because of formants. These are resonances of the throat, mouth and nose that boost certain ranges of frequency whatever note is being sung. They're what makes an "ee" different from an "oo", and a big part of what makes a voice sound like one particular person.
A plain pitch shift multiplies every frequency by the same ratio, formants included. Up 7 semitones the ratio is 1.498, so every resonance moves half as high again, as if the singer's whole vocal tract had shrunk by a third. That's the chipmunk sound, and step 7 of the lab plays it. Formant-preserving shifters fix it by measuring the overall shape of the spectrum, moving the notes, then putting the shape back. Melodyne, Little AlterBoy and Ableton Live's Complex Pro mode all have a formant control.
Time stretching leaves formants alone, since every grain holds a piece of the real voice at its real pitch. Stretch a vocal to 70% speed and the singer still sounds like themselves. What suffers is the timing inside the words: vowels drawl, and consonants like "t" and "k", which are tiny transients, start to blur or double. A breath or a vowel can usually take a big stretch, while a fast rap verse usually can't.
Can you do either one live?
Pitch shifting, yes. A pitch shifter can sit on a live microphone or guitar because its output lasts exactly as long as its input. It only needs to hold back a grain or so of audio to work on, which adds a small delay, and then it keeps up indefinitely. Eventide's H910 Harmonizer did this in hardware in the 1970s, and harmony pedals and live vocal effects still do it today.
Time stretching can't run on a live input. Slow a live signal to 50% and after 10 seconds of singing you've only played 5 seconds of it back, so you're 5 seconds behind and falling further back every second. Speed it up and you'd need audio the singer hasn't sung yet. That's why time stretching in a DAW happens to recorded clips on the timeline, and why live freeze and slow-motion effects record a short buffer and stretch that.
When to use each
| Job | Time stretch | Pitch shift | Varispeed |
|---|---|---|---|
| Fit a sample to your project tempo | Yes | No | Only if the key doesn't matter |
| Fit a sample to your project key | No | Yes | Changes the tempo too |
| Move a song up a tone for a singer | No | Yes | No |
| Add a harmony line to a vocal | No | Yes, with formant correction | No |
| Mix two tracks at different tempos as a DJ | Yes, with key lock | No | Yes, the classic way |
| Tune a drum loop or a kick | No | Works, can sound grainy | Cleanest, if it may get longer |
| Slow a sound right down for a texture | Yes, the further the stranger | No | Drops the pitch a long way |
Choose by asking which of the two the part is allowed to change. A sample that has to sit at your tempo and in your key needs both stretching and shifting, done separately. A drum loop with no clear key can usually let its pitch drift a little, so varispeed is fine for small tempo changes; a 120 BPM loop played at 126 BPM rises only 0.84 semitones. A vocal must keep its timing to match a recorded beat, so it gets shifted and never varispeeded.
How to fit a sample's tempo and key separately
- Note its original tempo and keySample packs usually put both in the file name. If you have to detect the tempo, check whether the result is half or double the real one.
- Switch on stretching and set the modePick a mode for the material: Beats for drums, Tones for single notes and Complex for full mixes in Ableton Live, or Slicing, Monophonic and Polyphonic in Logic Pro. Re-Pitch and Speed modes are varispeed, so avoid them here.
- Let the project tempo stretch itWith the original tempo set, the clip follows your project tempo on its own. Line up its first downbeat with your bar 1.
- Transpose in whole semitonesWork out the shortest move between the two keys and use the clip's transpose control. From A minor, C minor is +3 and F minor is −4.
- Listen for the artefacts each one leavesDoubled hits and smeared consonants come from the stretch, so try another mode or shorter grains. A thin, chipmunk or boomy voice comes from the shift, so try formant correction or a smaller transposition.
Common mistakes
Changing the tempo with varispeed on a melodic sample
Re-Pitch in Live, Speed (FX) in Logic and Varispeed in Pro Tools all move the key with the tempo. A melodic loop pulled from 120 to 128 BPM that way rises 1.12 semitones and lands between two keys, out of tune with everything else.
Blaming the wrong process
When a transposed clip sounds bad, the culprit is often the hidden stretch inside the pitch shift, and the warp mode is the setting to change. Drums transposed in a mode made for chords can flam just as they do when slowed down.
Shifting a long way when a short way exists
Any key is at most 6 semitones from any other, so a key change never needs a bigger shift than that. Going 9 down instead of 3 up means a hidden stretch of 40% instead of 19%.
Stretching or shifting the same file twice
Each pass adds its own artefacts. Keep the original file and make every change from it, instead of bouncing a processed copy and processing that again.
Training your ears to tell them apart
On a busy loop a tempo change is easy to mistake for a key change. The quiz under the lab plays a loop that has been time stretched, pitch shifted or put through varispeed, with the screens covered and the loudness matched, and asks which. Listen to the groove to judge the tempo and to the lowest note to judge the pitch, and press A/B to hear the original. Your best score is kept in your browser.
Questions people ask
Does time stretching change the pitch?
Not on purpose. A time stretcher keeps every note at its original pitch while the sound gets longer or shorter. The only way pitch moves is if you use a varispeed mode such as Re-Pitch in Ableton Live, which links the two, or if the stretch is so extreme that its artefacts add a tone of their own.
Does pitch shifting change the tempo?
No. A pitch shifter keeps the length and timing exactly as they were, so a loop at 120 BPM stays at 120 BPM in its new key. If the tempo moved, the sound was sped up or slowed down with varispeed, which changes both.
Which sounds worse, time stretching or pitch shifting?
It depends on the material. Time stretching is hardest on drums, where it doubles or smears the hits, especially when slowing down. Pitch shifting is hardest on voices, because it moves the formants that make a voice sound like a particular person. Both get worse the further you push them.
How do I change the key of a sample without changing its tempo?
Use your DAW's transpose control with a stretching mode switched on, such as any Warp mode except Re-Pitch in Ableton Live, or use Flex Pitch in Logic Pro. Transpose by whole semitones, and take the shorter route: +3 rather than −9 to go from A minor to C minor.
What is key lock on a DJ controller?
Key lock, called Master Tempo on Pioneer CDJs, is time stretching. With it on, moving the tempo fader changes the speed of the track while its key stays where it was. With it off, the fader works as varispeed, like a turntable, and the key moves with the tempo.
Why does a pitch shifter add latency?
Most pitch shifters work on short grains of audio, and they can't output a grain until enough of it has arrived. That wait adds a delay, usually a few to a few tens of milliseconds. Your DAW compensates on playback, but you may hear it when you sing or play through one live.