You are here

Time-stretching

Steinberg Cubase Tips & Techniques By John Walden
Published September 2007

Cubase is packed with as much functionality as Doctor Who's TARDIS for bending the laws of time, and while the basics are easy, it pays to explore a little deeper.

The Time Stretch function is not as scary as it looks!The Time Stretch function is not as scary as it looks!The ability to tempo-match audio loops in real time using modern audio editing and recording software is now something we take pretty much for granted. However, there are occasions when a more 'hands-on' approach is required to manipulate the timing of audio recordings. In these cases an off-line process can be required — Cubase includes the very useful Time Stretch audio-processing function for just such an occasion. As described below, such processing might have both corrective and creative uses. Time to get flexible...

Time For Change

The Time Stretch function allows you to change the length of a selected piece of audio without altering its pitch. The function, which is accessed via the Audio / Process / Time Stretch menu option, will operate upon the currently selected audio clip in the Project window. It can also be used with a whole clip in the Sample Editor window or, if required, a sub-section of a clip selected in the Sample Editor. If you find yourself using the function a lot, then it is worth assigning it a dedicated Key Command (it does not have one assigned by default).

At first glance, the Time Stretch dialogue can look a little complex. However, for routine tasks, only one or two settings might need adjustment. That said, the various controls do provide considerable flexibility, making a variety of different tasks easier to complete. Many of the controls also interact. For example, adjusting the Time Stretch Ratio slider will automatically change the settings under the Resulting Length section. These controls simply offer different ways of specifying the degree of time-stretching to be performed.

Whether you have selected a whole clip in the Project window or a sub-section of a clip in the Sample Editor, the Define Bars section (see the screenshot above) will automatically calculate the length of the original audio in terms of beats and bars. This assumes a 4/4 time signature so if you are working in 3/4 time (or something more exotic), then this will need to be adjusted (via the small arrowheads on the Sign control) for the bars and beats to be correctly calculated. It is also worth noting that the Beats value is shown rounded up to the next whole beat (fractions of a beat are not displayed).

The absolute length of the selected audio is displayed in both samples and seconds in the Original Length section. By default, the Project tempo is specified, but if you know the loop was originally recorded at a different tempo (as might be the case if you are importing a drum loop, for example), this can be adjusted. If adjustments are made here, the tempo setting in the Resulting Length section will also change in order to maintain the existing Time Stretch Ratio setting.

Providing the original audio was recorded at the same tempo as the project, the Define Bars and Original L

A number of different stretching algorithms are available.A number of different stretching algorithms are available.ength settings will take care of themselves, and it is the Resulting Length settings that will need to be adjusted. Changing any of these settings will automatically produce adjustments in the other two but, in most cases, the Seconds and BPM settings are easiest to work with, as users often have a target length or tempo in mind.

Both the Time Stretch Ratio and the Seconds Range settings provide alternative ways of defining the desired degree of stretching. The Time Stretch Ratio slider allows you to compress (shorten) or expand (lengthen) the selected audio by a percentage compared with the original. When un-ticked, the Effect tickbox constrains the stretch range between 75 and 125 percent, and this ensures that the audio quality is maintained (although more extreme settings will undoubtedly introduce some audio artifacts, particularly with exposed elements of a mix, such as vocals). When this tickbox is ticked, a larger degree of stretching is allowed and this mode is intended mainly for the deliberate abuse of the original audio — in other words, for special effects. The Seconds Range section can be useful if you know you need the audio to be stretched to a particular length. Usefully, the Use Locators button allows the required length to be set via the Project window locators, which makes it very easy to stretch the selected audio to fit a Project window section (or, for example, an exact number of bars).

Algo-rhythms

The final setting that requires some user intervention is which stretching algorithm to use. Two options are available: MPEX (Minimum Perceived Loss Time Compression/Expansion, based on Prosoniq technology) and Realtime. The former probably provides a more sophisticated approach and is therefore likely to give more natural results. The latter uses the same processing algorithm as the real-time time-stretching provided by the Audio Warp functions in Cubase. As this is optimised for use in real time, processing speed is a higher priority than absolute audio quality.

As described in the main text, adjusting bass or drum loops to the Project tempo is a breeze with the Time Stretch function.As described in the main text, adjusting bass or drum loops to the Project tempo is a breeze with the Time Stretch function.Both the MPEX and Realtime modes offer a range of different quality settings. However, as processing time is not really a significant issue for off-line processes, we will stick with the MPEX options here and, of these, there are three that offer higher quality results. Solo Musical provides the best results with monophonic sources, such as bass or vocals. Poly Musical provides similar results for either monophonic or polyphonic material, so it can also be used on more complex sources, such as drum loops or full mixes. To go that extra mile with polyphonic sources, there is also the Poly Complex setting, which is more processor intensive but is intended to give better results. For example, on my own test system, processing a full mix from 120 to 100 bpm (quite an extreme change) using Poly Musical takes almost as long as the track lasts, but it takes just over twice as long in Poly Complex mode. In my experience, the differences between these two modes are very much programme-dependent, and for some material, including vocals or exposed acoustic instruments, the results with Poly Complex do seem to be worth the extra processing time.

Tempo-matching

Adjusting the fade-out length of the final note of a cue to get it to fit an exact timing is easily done via the Sample Editor. Here, the final note has been selected for processing, and a loop region set for auditioning.Adjusting the fade-out length of the final note of a cue to get it to fit an exact timing is easily done via the Sample Editor. Here, the final note has been selected for processing, and a loop region set for auditioning.There are all sorts of corrective and creative applications for the Time Stretch function so, having got to grips with the key controls, let's now turn to some of these. Perhaps the simplest application is tempo-matching a pre-recorded loop to the Project. Cubase offers other ways of tempo-matching loops via its Time Warp and Hitpoint options (a topic I'm sure we will return to in a future column). However, if you just have one or two loops to process and know the original tempo they were recorded at, in most cases Time Stretch can achieve a perfectly acceptable result. For example, suppose we have a two-bar bass loop, originally recorded at 100bpm, which we wish to use in a Project at 110bpm. Once the loop has been imported into the Project window and selected in the Time Stretch dialogue, only three settings will need adjusting. First, within the Original Length section we need to set the Tempo In BPM to 100 (the original tempo the loop was recorded at). Second, the BPM value in the Resulting Length section should be set to 110 (the Project tempo). Finally, we would select MPEX and Solo Musical in the Algorithm section. Exactly the same process would be used with a drum loop, although the Poly Musical or Poly Complex modes would be more appropriate. Whatever type of loop we are processing, this method takes just a few seconds to complete.

Make Your Pitch

A number of the more creative applications of the Time Stretch function also require the use of pitch-shifting. For example, extreme pitch-shifting can be used in sound design to radically transform a sound, while matching the pitch of a vocal from one track with the backing from another is required when constructing a 'mashup' (unless, of course, you are deliberately going for an out-of-key 'punkmash' sound). Cubase does, of course, have an equivalent off-line Pitch Shift function and, as this includes both pitch-shifting independent of length changes and the ability to preserve formants (avoiding chipmunk or robotic 'Barry White' results with vocals), the results can be very good. The Pitch Shift function also includes an envelope tool, allowing the degree of pitch-shift to be varied throughout an audio clip. Of course, this is not a replacement for pitch-correction software such as Melodyne or Auto-Tune, but it does provide some useful corrective and creative possibilities.

The Right Time

The Pitch Shift function can be used alongside time-stretching for creative effects.The Pitch Shift function can be used alongside time-stretching for creative effects.As I mentioned earlier, the Time Stretch function can also be effective as a corrective tool. One such application is forcing a piece of music to a particular duration. You might, for example, need to do this in order to make a pre-existing track fit the length of an advertising slot precisely. Only very small adjustments (perhaps less than half a second longer or shorter) may be necessary but, depending upon the material, you can approach the task in a couple of ways. If the track comes to a dead stop, with no last-note fade-out or reverb tail, then it is usually easiest to process the whole track. In this case, it is often easier to use the Sample Editor to highlight the exact start and finish points. This defines the original length exactly when the Time Stretch dialogue is opened. All that you then need to do is adjust the Seconds setting in the Resulting Length section, and choose the correct algorithm mode (Poly Musical or Poly Complex for a full mix). However, if the piece has a well-defined final note with a bit of a fade on it, then an alternative approach can be used. The bulk of the piece can be left unstretched but this final note can be lengthened or shortened as required. In this case, just the final note is selected in the Sample Editor for processing and, providing the stretch is not too excessive, this can work very well. A loop can be set up in the Sample Editor to audition the end result and spot any audio artifacts between the stretched and unstretched sections.

Another corrective use of Time Stretch is tightening up individual notes in a performance. While most of us would agree that it is preferable to get a performance right at source, there are times when this just doesn't happen — whether it is down to running out of time, not spotting the occasional bit of sloppy timing during the recording session or where subsequent changes in the performance of one instrument require some editing of parts recorded earlier. In these cases, a little post-performance editing can help sharpen things up. For example, this can work well with bass guitar lines or guitar parts (although it does depend upon the style of playing — constantly strummed chords are more difficult to treat, whereas parts that feature chords that do not always run directly into one another can sometimes be tweaked successfully).

The Locators have been set around the exact length of a guitar chord. The corresponding bass note can now easily be adjusted to the same length, via the Time Stretch function's Use Locators button.The Locators have been set around the exact length of a guitar chord. The corresponding bass note can now easily be adjusted to the same length, via the Time Stretch function's Use Locators button.A simple example is shortening or lengthening individual notes in a bass line so that the note endings match more tightly with other elements within the piece, such as guitar or keyboard parts. This is obviously going to involve some quite detailed, note-by-note editing, and if the performance is really sloppy, then re-recording may prove more efficient. However, if only a few notes are problematic, or if sections of the bass line can be edited and then looped, time-stretching is a viable option. This process is most easily achieved if the bass line is first split into individual notes. Where there are distinct gaps between notes, the Detect Silence function (Audio / Advanced / Detect Silence) can do this very efficiently. Where notes do run directly into one another, then some manual splitting at the start of each new note might be required, using the Scissors tool in the Project window. Once separated, individual notes can then be corrected. When trying to match the length of the note to that contained in another track, the Use Locators option comes in very handy. First, the Project window Locators can be set exactly around the note in the other part to specify the correct length. The bass note requiring correction can then be selected and the Time Stretch dialogue opened. Finally, with the appropriate algorithm settings made, clicking on the Use Locators button will time-stretch the selected bass note to match the length defined by the Locators. If you devote sufficient editing time, you can achieve some very tightly locked performances.

There are similar potential applications, such as in audio post-production work, where Time Stretch can be used to fine-tune automatic dialogue replacement (ADR). Much like the bass guitar example above, individual words within the replacement dialogue track can be time-stretched to produce a tighter lip-sync with the visual material.

A Long Stretch

It isn't all about precision and correction: the Time Stretch function can also be a great tool for creating special effects, as part of a sound design process. For example, try making a recording of something innocent, like a small child laughing, and then time-stretch it, pitch-shift it down a couple of octaves (see the 'Make Your Pitch' box elswhere in this article) and apply some dramatic reverb — just promise me you won't play it back to the small child in a darkened room! Here, the whole point is to make the audio sound different, so preserving the original audio quality is less of an issue, and more extreme settings can be used. If you want to take this further, it is worth experimenting with multiple stages of time-stretching or pitch-shifting, perhaps with different effects applied in between.

Another creative use of the Time Stretch function might be to match the timing of two different recordings when creating a 'mashup' — where two separate songs are woven together in a remix. Some pitch-shifting might also be required, but the results can be surprisingly effective.

There are a number of ideas here that I don't have the space to explore in this article, but perhaps they'll form the basis of future Cubase columns. Until then, have a good stretch!