You are here

Sampling From Scratch — The Basics

Tips & Tricks By Paul White
Published September 1997

These days, few hi‑tech musicians would consider their studio complete without some kind of sampler. Paul White goes through the basics of these invaluable studio tools, for the benefit of anyone who has yet to sample one...

A great deal of contemporary music relies heavily on sampling, and some producers seem to delight in maintaining a barrier of mystique around the process, but the concept of sampling is really very simple. A sampler is essentially a synthesizer into which you can record your own sounds to use as raw material rather than relying on a set of factory samples or waveforms. If you look at the block diagram of a typical sampler, you'll find that it bears a very close resemblance to those of the original analogue synths. The main difference is that the sampled sound replaces the analogue synth's oscillator. Once a sound has been recorded into the sampler's memory, which uses the same type of RAM (Random Access Memory) as a computer, it may be played back from a keyboard, at any pitch, just like a conventional synthesizer patch.

In order for a sample to play back at a higher pitch than it was recorded at, the sample must be played back faster, just as when you varispeed a tape — so doubling the playback speed will raise the pitch by one octave and cause the sound to play for only half as long as the original. If you slow down the sample to lower the pitch, the sound will play for correspondingly longer. You've probably already noticed that moving a sound too far from its original pitch makes it sound unnatural — Mickey Mouse vocals are the most obvious example — but sometimes this capacity for strangeness can be used in creative ways.

Volatile Nature

Unlike the permanent ROM‑based sounds in synths, samplers store everything in RAM memory: when you turn off your machine, you lose all your sounds. Obviously, some form of permanent sound storage facility is required, otherwise you'd have to sample a new sound every time you switched on; most samplers come with an inbuilt floppy drive for this purpose. Be warned, however, that a floppy disk is really far too small for most serious sampling work — an additional hard drive or removable media drive is a must. Unfortunately, the most common samplers have their own floppy disk format, so you can't duplicate these floppies in your computer's floppy drive or transfer your samples directly to your computer's hard drive.

Sampling Applications

When samplers first came onto the scene, everyone went around the house blowing over bottles, hitting pans, and doing all kinds of other crazy things to come up with new musical sounds. Even the most mundane sound can be transformed into something musically useable by shifting it out of its usual pitch range. To make these sounds play back as chords, the sampler needs to work polyphonically in the same way as a synthesizer, and just as on any synth, there's a limit to the polyphony.

It wasn't long before sampler users figured out that if they could sample individual notes from instruments, they could also, given enough RAM memory, sample entire musical phrases or whole bars of drum rhythms. Sampling whole chunks of music is the cornerstone of modern dance music construction: the music is often built up from a series of drum loops — the term loop simply refers to a sampled section that can be repeated to form a continuous piece of music. However, you wouldn't normally loop this in the sampler — you'd trigger it once a bar.

Even the most mundane sound can be transformed into something musically useable by shifting it out of its usual pitch range.

So how much RAM memory does a sampler need? The answer is that it always needs more than you have, but the figure to keep in mind is that a mono sample lasting one minute will require about 5Mb of RAM at the CD sample rate of 44.1kHz. A minute may seem like a long time, but recording stereo samples will halve the available time. What's more, if you use the sampler multitimbrally, the memory will have to hold several sounds at the same time, which further reduces the length of individual sounds. As if that wasn't bad enough, some instruments have to be sampled every few semitones in order to create a set of samples that sounds convincing over the entire keyboard range, and, again, this takes memory. The good news is that RAM is now relatively cheap compared with what it was a year or two back, and most modern samplers let you add regular computer RAM rather than expensive proprietary memory boards. For that reason alone, it's worth filling your sampler to capacity as soon as possible.

Even with a full complement of RAM, you may still find that you need more sampling time, especially when you're using long samples or sets of multisamples in a multitimbral context. If you can make do with a lower audio bandwidth, setting a lower sampling rate will extend the available time; deliberately sampling at a very low sample rate can make sounds quite cheap and 'crunchy', a technique popular with dance‑music composers. Some samplers have a re‑sampling facility so that you can load a full‑bandwidth sample, then get the sampler to create a version using a lower sampling rate.

Looping

Sustained musical sounds, such as strings or flutes, don't change character very much after their initial attack, so one way to lengthen these is to find a section of the sound that has a consistent character, then repeat it by looping around it. Instead of sampling the whole duration of the musical note, you simply sample the first few seconds, then use the sampler's editing facilities to create a loop using material from the steady part of the note. Provided the loop points are carefully chosen, you'll end up with a note that plays smoothly for as long as you hold the key down. When the key is released, the sound will decay at a rate set by the sampler's release control, just like a synth. Looping neatly gets around this business of low notes being shorter in duration than high notes due to the different playback speeds.

Crossfade Looping

Unfortunately, few real instruments are co‑operative enough to produce a totally consistent level and character for very long, so often you'll find that even the most carefully selected loop point is audible as a change of timbre, an abrupt change in level, or even as a click. Clicks are a real problem in situations where you can't get the waveforms either side of the join to match up, so some samplers have the ability to force edits to the nearest zero crossing points — which are those parts of a waveform where it crosses over from being positive to negative or vice versa — but even this doesn't guarantee a click‑free loop.

Fortunately, most serious samplers have a facility called crossfade looping, which can help enormously. Simply put, instead of the end of the loop switching abruptly to the start, the sampler computes a gradual transition by fading out one end of the loop as the other fades in. The sampled data is then modified to reflect these changes and saved as a new version. A crossfade needs to be as short as possible, otherwise the sound during the crossfade may seem unnatural, but it has to be long enough to hide any sudden changes. Decaying sounds are often easier to loop if they're compressed, as this helps keep the level consistent.

Once you've tried editing your own samples, you'll realise why commercial sample CD‑ROMs are so expensive!

Even using compression, you may find that the sound's own natural decay means that you have a different level between the loop start and loop end, and even if you smooth this out with a crossfade, there'll still be an unnatural modulation effect occurring at the rate at which the sample loops. What's more, as you play notes higher up the keyboard, the modulation rate will increase. You might think that creating a much shorter loop will help, but then you find the repeating waveform sounds more electronic than natural. Analogue synth waveforms can be looped in sections as short as a single cycle, but with 'real' sounds, it just doesn't work out. Looping properly is a matter of experience, and if the original sound has any trace of vibrato or other modulation on it, you have to make the loop time a multiple of that rate too, otherwise the modulation becomes irregular. That's why it's best to work with completely dry, unmodulated source material when looping. Once you've tried editing your own samples, you'll realise why commercial sample CD‑ROMs are so expensive!

Stereo sounds are also awkward to loop because the waveforms in the two channels are different, and what constitutes a good loop point for one channel may not work so well for the other. Crossfade looping can rescue an otherwise impossible stereo loop, but most of the time a mono sample with stereo effects added during the mix is more practical. Drum loops, which may need to be in stereo, are no problem: you don't loop them in the sampler — you simply trigger them from your sequencer each time they are needed.

ADSR

A looped sample may have the same attack as the original instrument, but the decay portion is replaced by a loop, so an ADSR‑type envelope shaper is needed in order that the sampled sound level can be changed over time, in the same way a synth sound can be changed. Different models handle the creation of envelopes in slightly different ways, but the concept remains the same.

The better samplers also include resonant filter sections similar to those found in synthesizers. The filters may be controlled by envelopes, LFOs and so forth, making it possible to create very analogue‑like sounds. Indeed, if you start off with looped samples of basic analogue synth waveforms, it's possible to create very authentic analogue synth emulations, and because the samples are only a single waveform long, they take up very little sample memory.

Triggering Samples

There are two main trigger modes for samplers — 'one‑shot' trigger mode, where the sample always plays to the end, regardless of whether or not the key that has triggered it remains held down, and the more conventional 're‑trigger' mode, whereby the sample goes into its release phase as soon as the key is released. One‑shot mode is useful for triggering drum loops and for individual drum sounds, whereas re‑triggering is used for most conventional instrument sounds. Again, different manufacturers may use slightly different terminology to describe these modes of operation.

Multi‑Sampling

Most sounds become quite unnatural when transposed far from their original pitch; this can sometimes be a creative advantage, but usually you want an instrument to sound as realistic as possible, especially pianos and orchestral instruments. The only way to maintain a natural sound is to take several samples of the instrument at different pitches, then use each sample over only a limited part of the keyboard. Ideally, you'd take a fresh sample every semitone, but that would eat up lots of memory and it takes forever to do. In practice, using the same sample over a range of three or four semitones is generally accurate enough even for the most critical instruments, and often you can get away with far fewer samples. Pianos are very critical; bowed strings and wind instruments are more forgiving.

How much RAM memory does a sampler need? The answer is that it always needs more than you have.

On some samplers, it is possible to use more than one sample in a keygroup, then either crossfade or switch between them according to MIDI velocity. Crossfading can sound smoother but, because two samples are always playing at the same time, your polyphony is halved. Popular examples of velocity switching include the bass guitar sample, where modest velocities trigger a plucked sample and high velocities trigger a slapped or pulled sample. Other uses include wind instruments that are sampled with an 'overblown' sound at higher velocities, and instruments that sound noticeably different in some other way when played loud. In general, instruments tend to sound brighter when they're played louder, and this can be faked to some extent using the sampler's filter linked to MIDI velocity.

Spinning In

With cheaper RAM and longer sampling times, it's now practical to sample quite long musical phrases and vocal lines, triggered by a single key press. This allows the sampler to be used for 'spinning in' sections of vocal, a job that used to be done by trying to start a second tape machine at the right time. For example, you could sample the best chorus from a recording, then trigger it to play for every chorus. Hard disk audio workstations are able to do this rather more easily but, for users working predominantly with tape, the technique can be used at a number of levels, from replacing specific instrumental or vocal sections to assembling a whole song. As a rule, the sampler would be triggered from a sequencer sync'd to tape in order to keep the timing precise. With analogue tape, the speed is liable to drift slightly, so the sampled sections should be kept as short as is practicable.

Sampling Is Easy?

The process of sampling isn't difficult, but it can be incredibly time‑consuming, especially where multisampling or looping is required. Regular instrument sounds are available from sound libraries; though sample CDs and CD‑ROMs can be expensive, they relieve you of an enormous amount of work, and when it comes to orchestral sounds, for example, few individual users would have the resources to create these for themselves. CD‑ROMs do all the looping and keygrouping work for you, while CDs contain audio samples alone, which you still have to loop and organise into keygroups — so I'd strongly recommend that anyone without a CD‑ROM drive gets one as soon as possible. Most library CD‑ROMs are supplied in a format suitable for Akai samplers, but current Roland and Emu models will usually read each others' formats without too much trouble.

Editing Software

If you're going to do a lot of sampling and sample editing, a computer‑based sample editing package will make the job much easier than peering into a tiny LCD window. If you have a suitable computer and you don't have one of the samplers that supports a computer monitor directly, an editor is well worth considering. Sample editors are available for both Mac and PC platforms, and Akai have their own MESA editor for Mac, with a PC version planned shortly. MIDI may be used to transfer samples between a sampler and a computer, but it's mind‑numbingly slow: a system that can transfer samples over SCSI is far more satisfactory.

Sampling Levels

Sampling is a digital recording process and, just as when you're using a conventional recorder, you have to sample the signals at the highest possible level if you want the best signal‑to‑noise ratio and the least distortion. However, digital recorders won't tolerate clipping, so use the metering on your sampler very carefully to make sure that the peak signal level is as high as it can be without actually hitting the end stops. If the sound source isn't repeatable, either record it first on analogue tape or use a compressor/limiter on the input.

Sample Storage

A sampler's integral 1.44Mb floppy drive will hold around 15 seconds' worth of mono samples, which isn't a lot of use if you have a 32Mb memory. I use a 100Mb Iomega Zip drive on my Akai S2000 and find it suitably fast and quiet, and the cost of both the drives and the blank disks is quite low. Though a higher‑capacity medium is arguably more convenient, you risk losing more if a disk becomes corrupted. The same is true of large‑capacity hard drives — everything mechanical fails sometime. It might be as well to check with any other musicians or local studios with whom you are likely to collaborate, as it can help to use the same type of storage media.

Drum Loops

As mentioned elsewhere in this article, you could record a drum part into a sampler, then set the sampler to loop continuously to give you an indefinitely long drum part, but the chances are that it would drift out of sync with your sequencer eventually. A more reliable option is to set the drum part up as a one‑shot sample, then trigger it once every bar (or however long the drum sample is) from your sequencer. This will ensure the timing doesn't drift, because sync will be established afresh at the start of each bar. The same is true of repeating guitar riffs. Long vocal sections may also be broken down into shorter samples if there are sync problems.