Looping Techniques

This document describes a range of simple and advanced techniques for looping samples - It was written for users of Akai samplers but is applicable to other hardware and software.  Of course these are only suggestions, and you should feel free to apply these techniques to the 'wrong' sounds if it gets the result you need!
 

Introduction
The main use for looping is to extend a sample so it isn't limited to the length of the original recording.  You mark the part of the sample to be looped with a start and end point (or a length and end point) and whenever the end point is reached playback jumps back to the start point, extending the sound for as long as you want.
Where looping becomes complicated is that if the waveform at the start of the loop doesn't match the end of the loop (and it has to match in level, pitch and tone) you will hear the join.  The usual way around this is to spend a lot of time finding a good loop point.  That's usually the best place to start, but if you haven't found a good loop in five minutes try a more advanced technique...
 

Drum loops
Drum patterns are the easiest samples to loop, as the drum hits can be used to cover up a bad loop point.  The most important thing to get right is the loop length - this will affect the whole feel of the loop - and this is where samplers that let you set the loop length and position are better than ones that set the loop start and end points separately.

If you are using a sequencer you should re-trigger the loop every few bars (and maybe not loop the sample at all) because unless your loop length exactly matches the tempo of the sequencer the timing will drift.  Using a combination of looping and re-triggering can give you some creative freedom -  for example, if you loop beats 3 and 4 of a 4-beat sample you can make several longer patterns:

       1-2-3-4, 1-2-3-4       1-2, 1-2, 1-2-3-4       1-2-3-4-3-4-3-4

(a comma shows re-triggering of the sample).  You can get other effects by looping different parts of the sample, having more than one loop, and by changing the start position of the sample so it doesn't begin with the first beat.
 

Drum hits
Normally it is a bad idea to try and loop individual drum hits, and it is better to take a longer sample in the first place.  However, there are two techniques you can use depending on the type of sound:

For pitched sounds (808 kicks, toms, tablas) make as short a loop as possible as near to the end of the sample as possible.  The techniques described below for looping waveforms apply here - Try and loop exactly one cycle and check that the  loop has the same pitch as the main body of the sample (or perhaps slightly lower for toms, you could even apply a falling pitch envelope).

For unpitched sounds (cymbals, reverb on snares) make as long a loop as possible without including the initial drum hit.  An alternating loop will give the smoothest sound but this is not available on some samplers.  A long crossfade can also help.  If the loop point is too obvious, you may be able to muffle it with a low-pass filter or hide it in a reverb.  For sounds with a mixture of noise and a strong pitch, good luck!
 

Simple waveforms
This mainly applies to single-cycle samples, but can also be used for sounds that settle to a simple waveform (such as a short filter sweeps or bass notes).

The problem with looping a single cycle, is that you lose any variations in the waveform that happen over a longer period such as vibrato, background hiss and any other thumps, buzzes and whistles that are part of the sound.  This is a particular problem with background hiss which will stop abruptly when the loop starts and will take on a 'buzzing' or 'fluttering' character.  Sometimes you can get away with using a low-pass filter to muffle the sound as the loop starts, but the best thing to do is avoid the background noise.  If you have to sample from cassette tape, try using more noise reduction to cut down on the hiss (Dolby C can remove a lot of noise from a Dolby B recording).
 

Samples of samples
Most digital synthesizers base their sounds on built-in samples.  These samples can be very useful as they are have already been selected and processed by the manufacturer for maximum impact, recognisability and usability.

To get a clean version of these waveforms, it is usually easiest to select a piano sound on the synth then edit it so the filter and amplitude envelopes are fully open (minimum attack, maximum sustain) with all effect and modulation depths are set to zero.  You should then be able to listen to 'clean' versions of the built in samples to hear where the loops and multisamples are.

When you have taken a sample of a sample you need to find the loop length that was used on the original.  This is where a waveform display is useful as you should be able to see a repeating pattern in the level of the waveform.  Find a dip in level and position the other end of the loop at the next corresponding dip. It can be useful to set up a loop a few seconds into the sample, then when it is set to the correct length, and fits in with the rest of the sample, move the position of the loop as near to the start of the sample as possible  - you will often find you can get it very close to the start.
 

Loop-until-release (electric bass, harpsichord...)
If you want a particular sound at the end of a sample (for example the thump of a string being stopped) there are three approaches:

The easiest way is to start with a sample of a stopped note, set the loop mode to loop-until-release and loop a small region just before the 'stop'. The problem with this method is that when you take your finger off the key, you don't know where you are in the loop, so you don't know exactly when the 'stop' will arrive.  This can sound messy unless you use a really short loop.  Of course, ethnic instruments might sound more authentic if you include these random clunks and bangs!  You will need to adjust the envelope release to carry on playing after you have lifted your finger from the key, and if a decaying envelope is used you may need to apply a more complicated envelope, or use a second envelope to set the playback level of the 'stop' sound.

The less easy way is to have the 'stop' sound as a separate sample (copy it from the original note sample if needed) set to loop-until-release with a very short loop at the start.  Hopefully the very small looped region at the start of the sample will be silent, so while a key is held down the sample will not make a sound, and when the key is lifted the remainder of the sample (the actual sound you want) will play.  This gets around the problems of sharing an envelope with the note sample and can make the timing much tighter, but doubles the polyphony used.

The method that gives you the most control is to have the 'stop' sound as a separate sample, possibly assigned to one key at the end of your keyboard, but sharing a mute group with the note samples.  This lets you cut off any sounding notes with one or several 'stop' sounds, and gives you control over the level of both without using any extra polyphony.
 

Sustaining sounds (flute, strings...)
These are probably the easiest sounds to loop.  All you have to do is find a loop where the waveforms either side are pretty similar, and if there is any vibrato or tremolo take a long enough section of waveform to preserve this.  Some simple sounds such as oboes and clarinets can produce good sounds with very short loops.
 

Decaying sounds (piano, guitar...)
The problem with decaying sounds is that the beginning of the loop will be louder than the end of the loop, so you will hear a jump in level.  You may also hear a change in brightness, but this can be avoided by moving the loop further away from the start of the sample.

To get a really good loop you will need to fade up the level of the sample as it decays, so the start and end points of the loop match.  With some practice you can do this by turning up the sampler's input gain while you are sampling, but if you are sampling from digital inputs or want a bit more control, you will need a computer-based editor.  Apply a logarithmic fade to the whole sample, starting at 0dB and ending somewhere between +10 and +30dB - undo and retry a few times until the decay has turned into a constant level.

It is a good idea to use the sample editor's remove dc function before applying the gain.  With some editors you will have to use an envelope or several linear fades to get the same result as a logarithmic fade.  A side effect of this technique is that the background noise in the sample fades up where before the sample faded down.  This isn't a problem as it can help mask the loop point, and when you apply a decaying envelope the noise will be no worse than it was in the original sound.
 

Stereo samples
Stereo samples can be very difficult to loop as the left and right waveforms rarely match up at a particular point.  On samplers that treat the left and right channels as separate files you may be able to find a good loop for each channel on it's own, but if the resulting loops are different lengths the samples will drift relative to each other, and you may get phasing or strange stereo effects.

Sometimes crossfades are the only way to get stereo samples to loop, but this can cause a bump or dip.  Probably the best solution is to find a good loop for the mono component, then apply a long crossfade to the stereo component, but I haven't yet seen an editor that supports this without a lot of work!   This is how to do it:

Another solution is to use a mono sample, but make it pseudo stereo on playback - either with effects, or by panning two detuned versions hard left and hard right.  With detuning you may get some phasing (especially if you listen in mono) or flamming as the two samples drift further apart, so it may be better to use a short delay on one channel by adjusting the sample start point offset.
 

The science bit
Sometimes it helps to calculate the exact loop length for a sound, but you shouldn't rely on calculations to get you the best sound, and even if a loop sounds good, check a few samples either side for a better sound.  Remember that these equations are only as good as the tempo or pitch measurements you put into them:
 

To find the loop length for a drum loop:
     
      Samples  =  Fs  x  Beats  x  60  /  BPM

Where Fs is the sample rate in Hz, Beats is the number of beats to loop, and BPM is the tempo.

To find the loop length for a single waveform cycle:

    Samples  =  Fs / (8.1757989  x  1.0594631Note)

Where Note is the MIDI note number (middle C is 60) and Fs is the sample rate in Hz.  If this loop length doesn't work try multiplying by 2, 3, 4, or some other number of cycles.  Incidentally, the lower part of the equation calculates the frequency of musical notes, for example note number 69 (A3) gives 440 Hz. 

 


This document is quite new, so if you have any comments on what else to include please let me know!
Copyright ©1998 Paul Kellett (paul.kellett@maxim.abel.co.uk)

Goto Top of Article

Article List

Home Page