¡Obtenga asesoría en español!  Llámenos hoy a (800) 222-4701
(800) 222-4700 Talk to an expert!
Loading Cart
Your Cart Is Empty

See what's new at Sweetwater.

My Cart this.cartQty
Recording Guitar Bass Keyboard Drums Live Sound DJ Band & Orchestra Content Creators Worship

How to Use Time Stretching

How to Use Time Stretching

If a Google search landed you here because you were searching for something involving yoga and stretching, you’re in the wrong place. Sorry. We’re going to talk about making music.

If, on the other hand, you’re looking for an answer to one of the following, then you’re in the right place.

  • You recorded a song, and it’s mixed and mastered. It sounds great, but — it seems to drag a little. You wish you had recorded it at 122 bpm instead of 120 bpm.
  • You got a gig creating the music for a 30-second commercial. However, you ended up with 32 seconds. You need to shorten the music to fit the allotted time.
  • There’s a percussion loop that would really enhance a song you’ve done, but it’s too slow. Or too fast.
  • You’re in the middle of recording a song, but you were waaaaay too caffeinated when you started laying down tracks, and now you want to slow it down a bit before finishing it.
  • On various internet forums, you’ve heard rumors that back in the days of tape, musicians often sped up the final master tape by a few percent to raise the pitch, which simultaneously raised the pitch/formants to make the music brighter. So where do you find the “vintage Ampex tape recorder variable speed” control in your DAW?
  • You recorded a fantastic rhythm guitar part, and having read my article on “5 Reasons Why Loops Aren’t Only for DJs” want to turn it into a loop — but the tempo changes throughout the song.

Fortunately, there are answers for all of these. But first, some background.

How Stretching Works

Stretching may not violate the laws of physics, but it sure bends them. To shorten audio, a stretching algorithm has to remove pieces of audio and splice them back together again so they take up less time. This often involves crossfading and other serious DSP voodoo so the audio doesn’t sound like, well, pieces were removed and then spliced back together again.

Lengthening audio is even tougher, because now the stretching algorithm has to create audio that didn’t exist previously to make the file longer. Again, a combination of slicing, dicing, and crossfading (there’s probably folding, bending, stapling, and mutilating somewhere in there too) is necessary to make this happen, but it’s a challenge. Which brings us to…

Rule #1: With any stretching method, speeding up audio rather than slowing it down gives better fidelity.

In the early days of digital audio, stretching meant compromising audio quality. Fortunately, as computers have become more powerful and software developers more savvy, today’s stretching algorithms can alter audio — providing the stretching isn’t extreme — and still have it sound natural.

Quality stretching requires coding expertise. You’ll find stretching algorithms from zplane (a company that specializes in stretching) in software from Ableton, IK Multimedia, Magix, PreSonus, Steinberg, and others; zplane also makes a plug-in version. iZotope’s Radius stretch algorithm is excellent for offline processing (and is the basis of Avid’s X-Form plug-in). There’s also Serato’s Pitch ’n Time plug-in for Pro Tools, and Zynaptiq’s ZTX Pro time/pitch-stretching technology in MOTU Digital Performer 9.5. So how do you get the most out of these?

Real-time vs. Offline Stretching

Because of the complexity of stretching algorithms, real-time stretching is more demanding than offline stretching. Which brings us to…

Rule #2: You’ll usually obtain better results from offline rendering than real-time stretching.

At seminars, people often ask me what to do when they start a project at one tempo and change their minds halfway through. Here are your real-time options:

  • If the project consists exclusively of MIDI files triggering notes, you can do anything you want with the tempo because there are no audio files per se. This is why I recommend that when songwriting, it’s best to flesh out the song using MIDI-triggered virtual instruments, so you can nail the key and tempo before you start recording audio.
  • If the audio files are REX files, Acidized WAV files, or Apple Loops (described later), they’ll follow tempo changes — up to a point. In addition to having the best results when speeding up instead of slowing down, you’re also at the mercy of the people who converted standard audio files to stretchable formats. The conversion process is a cross between an art and a science — and not all loop libraries succeed at both.
  • The program may allow simply changing the tempo, and the files will follow along. For example, with PreSonus Studio One, if you tell the program to stretch the file upon importing or recording (fig. 1), the audio will follow tempo changes. In Steinberg Cubase, if you select Stretch to Project Tempo, a loop will conform to the tempo (if you select Musical Mode, it will also follow tempo changes).

Figure 1: In Studio One, in addition to specifying that you want audio files to be stretchable and follow tempo changes, you can enable a cache for higher-quality stretching (this gives performance more like offline rendering, but in real time), and record tempo metadata with the file.

And here are your non-real-time options:

  • Process the audio files with your program’s time-stretching DSP. For example, suppose you’ve recorded 10 tracks at 120 bpm and want to convert the song to 125 bpm. Render all the clips in a track to make continuous tracks, and make sure they all start at the song’s beginning. Next, slip-edit the end of every track to a specific measure at 120 bpm — for example, measure 137. Now, change the tempo to 125 bpm and shorten each track’s audio so that each one ends at measure 137. Usually a program will have a time-stretching tool (fig. 2) where you click at the end of the clip and drag until it reaches the desired length to fit with a new tempo.
  • My preference is to keep recording at the original tempo to avoid doing any stretching until the very end. After you mix the song, stretch the final master to the faster tempo. This way, only one file is being subjected to stretching.

Figure 2: Selecting Time Stretch mode (outlined in red) for Cubase’s Object Selection tool can lengthen or shorten an audio clip by clicking and dragging (outlined in yellow). This FLAC file is being stretched to a measure boundary so that it ends precisely at measure 6.

Stretch like Variable-speed Tape

The easiest way to stretch (and the most artifact-free) is to resample and stretch both pitch and tempo at the same time — just like variable-speed tape recorders. Unfortunately, this isn’t a very common option, because developers have emphasized being able to stretch tempo or pitch independently of each other. However, this means you can do the tape speed effect by varying both parameters simultaneously; and Sound Forge’s use of élastique makes it easy to alter pitch and time simultaneously (fig. 3).

Cubase implements a Tape mode using zplane’s élastique algorithm, which also allows locking pitch and tempo so that they change together.

Figure 3: Sound Forge uses zplane’s élastique Timestretch to shift both time and pitch and can do so simultaneously — as well as lock them together so they can create an effect such as tape variable speed.

What About Stretchable File Formats?

Stretchable loop file formats follow tempo changes. They work by slicing a file at transients and referencing slices to the rhythm (e.g., 16th-note slices are anchored at 16th notes within a measure) instead of the tempo. Therefore, when you change tempo, the slices remain faithful to the rhythm, which follows the tempo.

The three main stretchable audio loop formats are REX files, Acidized WAV files, and Apple Loops (Apple Loops use the same principle as Acidized files). REX files are arguably the most universally recognized, with Acidized WAV files a close second. Mac programs generally recognize Apple Loops, but few Windows programs do. Many programs on both platforms recognize Acidized files.

The REX file format does its magic by using MIDI notes to trigger individual slices; Acidized files don’t slice the files physically but use transient markers to identify where to stretch the audio with DSP. Creating files in either format is a challenge. The only program that can create and edit REX files is Propellerheads’ ReCycle (fig. 4).

The only programs that can create and edit Acidized files are Magix Sound Forge Pro, Magix Acid Pro (fig. 5), and Cakewalk by BandLab.

Figure 4: A rock drum loop is being converted into a REX file. The markers indicate the start of slices that are referenced to the rhythm.

Figure 5: Acid Pro can “acidize” files to convert them into stretchable formats. Transient markers are added that tie the start of each segment to the rhythm.

However, most DAWs can read these file formats, and some include their own methods of creating stretchable files — like Cubase’s Hitpoints. However, as digital audio DSP improves, stretchable file formats aren’t as crucial as they were when they were introduced.

Different formats are best for different types of audio. REX files are optimum for percussive audio, as long as prominent sounds don’t decay over other sounds (e.g., a cymbal that sustains for a measure, sounding at the same time as a 16th-note hi-hat pattern). A single-note bass line or simple drum part is the ideal candidate for REXing. With isolated, percussive sounds, REX files slow down better and don’t alter the fidelity because only a slice’s start point changes — the slice itself isn’t necessarily stretched, although you can stretch the end if slowing down the tempo causes a gap between slices. WAV and Apple Loops aren’t always as good for percussive sounds as REX files, but they are better with everything else — particularly sustained sounds.

Some programs and virtual instruments can extract the MIDI notes that trigger REX file slices. This means that by rearranging the MIDI notes, you can rearrange the slices they trigger. It’s easy to create variations on a rhythm pattern with this technique (fig. 6).

This kind of slicing and dicing is particularly effective with drum loops, because owing to the nature of REX files, each slice tends to be a single hit consisting of one or more drums. If you move these hits around, you can create totally different drum patterns.

Figure 6: In Propellerhead software’s Reason, the slices driving a rhythm guitar part have been moved around in a phrase’s final measure to create a musically useful variation.

“Faux” REX Files

Our final stretching option is anchoring one-shots to the timeline, which uses the same kind of principle as REX files. For example, suppose you drag a kick one-shot to each beat of a measure. If you speed up or slow down the tempo, the kicks will still be on each beat. Although it can be time consuming to create loops from one-shots, with proper editing you can have a part that stretches to almost any tempo. You can also do something similar by loading a loop at its native tempo, creating slices at each beat or transient, and doing whatever is necessary to turn each slice into its own clip (typically bouncing it to itself). Some programs have a semiautomatic function for doing this. For example, with Studio One, you can insert Bend Markers in a clip, then split at all Bend Markers simultaneously (fig. 7). As with REX files, each slice will follow the tempo.

Figure 7: The file in the top track, which was three measures long at a faster tempo, was split automatically at its native tempo, using Bend Markers in Studio One’s Edit view (bottom). The individual slices are anchored to the rhythm, which is why the slices in the second track stretch to the correct number of measures at a slower tempo.

Because there’s no actual DSP-based stretching, each slice’s sound quality is unaffected when stretched in this manner. However, you may need to add fade-outs at the end of each slice to prevent clicks or abrupt endings.

That’s a Stretch

We’ve come a long way since time stretching meant sampling phrases into a keyboard sampler then playing notes in time with the music. Then again, the basic principle remains the same — the process is just more automated. So the next time something is not fast enough, not slow enough, or doesn’t follow tempo changes, no worries: just do a little stretching.

In this article

Shop Sweetwater

About Craig Anderton

Craig Anderton leads a dual life as a musician and author. As a musician, he has played on, mixed, or produced over 20 major label releases, as well as mastered hundreds of tracks, and recently released the album Simplicity. As an author, he has written over a thousand articles for magazines like Guitar Player, Sound on Sound, and Pro Sound News. He has also lectured on technology and the arts in 38 states, 10 countries, and in three languages. His web site is craiganderton.org
Read more articles by Craig »