Get Real - EMusician

Get Real

HOW A SAMPLER DOES ITS MAGIC
Author:
Publish date:
Image placeholder title

Until the late 1970s, synthesizers were used primarily to create new and unusual types of sounds. But by 1980, keyboard players were clamoring for synths that could stand in for traditional instrumentation such as string and brass sections and electric bass.

The synthesizers being built at that time weren't especially good at imitating real-world sounds. To fill that need, companies such as Akai, E-mu, Ensoniq, and Fairlight developed the first samplers. A sampler can sound exactly like a string section, a solo French horn, or whatever else you need, because it plays samples (digital recordings) of the real thing.

Problem solved? Not exactly. For all its power and promise, sampling technology is far from perfect. In this column, I'll describe what can go wrong when you play the keyboard of a sampler.

Image placeholder title

FIG. 1: The ImpOSCar settings as heard in Web Clip 2 have a deep, square-wave sound. Only one oscillator is on.

Because most samplers today are capable of ultra-high-fidelity recordings, I won't discuss bit rate or sample resolution, which were major issues in samplers in the 1980s. Unless you're using a very old piece of gear, your sampler or sampling software can record with at least 16-bit resolution at the standard CD sampling rate of 44.1 kHz, so achieving good sound quality won't be difficult.

Terminology

The word sample refers to a complete digital recording (for example, a recording of a trumpet playing a single note). The same word is sometimes used to refer to a single numerical value that makes up the recording. To avoid confusion, we'll refer to such values as sample words.

Hardware-based samplers, including modern workstation keyboards like the Yamaha Motif and Alesis Fusion, have audio inputs to allow them to record new samples. Only a few software-based samplers, however, are capable of recording directly. Software instruments are generally used in a computer audio environment, in which some other program does whatever recording is needed. Calling an instrument that can't sample a sampler isn't quite correct. Nevertheless, the word is used when referring to software programs that can play back any digital audio file you choose, typically under MIDI control.

A sample-playback synthesizer, in contrast, makes sound using a fixed library of samples. It does not allow you to load your own.

Tailspin

Early samplers had extremely limited amounts of memory compared with modern instruments. To fit a number of samples into memory at the same time, each sample had to be kept very short. But musical notes are often many seconds in length; for notes to be sustained as long as necessary, samplers loop.

Looping is also used to repeat sampled drum beats, but that's a more recent musical development. The process here consists of repeatedly playing back a sample that contains a single note, such as a note played on a trumpet or an organ.

When a key is pressed, the assigned sample starts playing from the beginning. When the loop end point is reached, playback jumps back to an earlier spot called the loop start point and continues as before. Each time the end point is reached, playback jumps back to the loop start point (see Fig. 1). This continues until the key is lifted and the amplitude envelope generator shuts down, allowing the note to die away.

Many samplers offer even more-complex looping schemes. For instance, loop playback can occur in a back-and-forth fashion rather than jumping from the end back to the loop start point. Back-and-forth looping, or bidirectional looping, can sound smoother than ordinary looping because there's no jump.

No matter how it's done, looping is not a perfect way to create a sustained sound. The audio in a loop is static and unchanging, while the tone of real instruments is not. And finding loop start and end points that create a smooth loop is not easy (see Web Clip 1).

Modern computer-based samplers can play looped samples, but many of them are capable of dispensing with looping entirely. Because the computer has lots of memory and can play audio directly from its hard drive, the sampler may stream (play back directly from the hard drive) samples from the drive as the keyboard is played. This works well with sounds that die away naturally, such as piano notes, but not so well with sounds like string orchestra, which may need to sustain a single note for an unknown length of time. The latter will usually be looped.

Transposition

When you run your fingers up and down the keyboard of a sampler or sample-playback synth, you'll probably hear a chromatic scale. When you play higher on the keyboard, the sample plays back more quickly, which raises its pitch. When you play lower, the sample is played more slowly, lowering the pitch. What could be more natural, right?

But getting a digital recording to play “faster” or “slower” isn't simple or natural at all. Unlike a turntable, which can speed up and slow down and thereby alter the pitch, the sampler's audio output runs at a fixed sampling rate — for example, at 44.1 kHz. That rate, which is the speed at which the sample words are sent to the audio output device, can't change. If you want to play the sample more quickly, you can't jam the sample words within the recording closer together, so you have to skip some of them entirely. If the sample is to be played more slowly, the existing sample words can't be spaced farther apart. Instead, new sample words must be found so that the recording as a whole will last longer.

First-generation samplers performed this type of transposition in the simplest possible way: if the sample needed to be made shorter, some of the sample words were simply dropped. If the sample needed to be longer, certain sample words would be repeated.

Image placeholder title

FIG. 2: Fig. 2a shows a 500 Hz sine wave. Fig. 2b shows the same sine wave -transposed up to 583 Hz by dropping -samples. Fig. 2c shows a 583 Hz sine wave created using interpolation; it has no dropped samples and is therefore smoother.

This method, called drop-sample transposition, distorts the shape of the waveform, as seen in Fig. 2. This distortion is one reason that older samplers have a distinctive sound.

Modern samplers perform mathematical interpolation to make the waveform longer or decimation to make it shorter without distorting its shape noticeably. For every sample word that's added or dropped, the sampler adjusts the values of one or more adjoining samples to keep the waveform smooth. The distortion caused by changing the pitch of a sample is no longer an issue that we need to worry about.

Transposition causes other problems, though. If you sample a single midrange note on a guitar or almost any other instrument and then transpose it up or down over several octaves, you'll discover that the farther from its original pitch the note is played, the less realistic it sounds (see Web Clip 2). To understand why, consider the snap of a guitar pick hitting a string. That snap is part of the sampled sound. If a sample of a guitar string being plucked is transposed down an octave, the tone of the string may still be acceptably realistic, but the snap will be too low pitched and will last too long. It will sound as though it were made by a large, soft pick. If the sample is transposed up by too many half steps, the snap sound will become high pitched and brittle, as though the string were being picked by a thumbtack. Again, the sample won't sound much like a real guitar.

Some sounds survive transposition better than others. Mallet percussion, for instance, can often be transposed over a couple of octaves before it starts to sound unacceptable. The human voice, on the other hand, can be transposed by no more than a few half steps before it becomes comical. That is because all of the frequency components of the sample (its partials) are transposed up or down by the same amount.

Trickery

To deal with the sonic problems posed by sample transposition, instrument designers created a technique called multisampling. With multisampling, a number of separate samples of the same source instrument are recorded playing single notes at a number of different pitches. These samples are then assigned to separate zones (ranges of notes) on the keyboard. Multisampling is not a perfect solution, however. Professional sound designers spend lots of time matching samples up and down the keyboard. But a well-produced multisample can sound amazingly realistic across a wide range.

Jim Aikin writes about music technology, plays electric cello, and still has time for rambunctious political opinions. Visit him online atwww.musicwords.net.