You are here

Perfect Piano Loops

Tips & Techniques By Craig Anderton
Published July 1994

Sampled piano aficionados know the particular problems involved in constructing a good loop of this essential instrument. Craig Anderton passes on a personal solution.

Many samplers and synthesizers are judged on the quality of their piano sounds. I'm sure part of this is because people who can't afford the bucks or space for a grand piano look to their electronic instruments to do the best possible simulation — but sampling fans recognise that a piano is a hellishly difficult sound to sample. If an instrument can get a piano right, it can probably do a good job on other sounds.

The problems of piano sampling were brought home to me while porting pianos from a commercial sample library over to the Ensoniq EPS and EPS 16 Plus. The quality of the samples was just fine, but if you've ever tried to sample a piano, you know what the difficulties are:

  • Pianos are percussive instruments, with envelopes that decay over time. As a result, unlike a wind instrument or organ, there's no steady‑state, constant‑amplitude portion of the signal that would allow for a long forward or crossfade loop.
  • The envelopes take a long time to decay. Therefore, unless you have humongous amounts of internal memory, you will not be able to fit several samples with natural decays into a sampler, thus making looping a necessity.
  • Given all this, it seems that grabbing a single‑cycle loop as close to the end of the waveform as possible would give the best results. And here's where the big problems begin.

When you strike a key on a piano — excepting the lowest strings — you are actually setting two or three strings into vibration. Because of the nature of piano tuning, the odds are excellent that these multiple strings will not all be tuned to exactly the same frequency, which gives a natural chorusing effect and accounts for some of the piano's inherently rich sound.

Unfortunately, if you try to loop a single cycle of a chorused sound, there will usually be an unsettling change in pitch and richness during the transition from the body of the sound to the loop. Firstly, the chorusing effect will disappear, making it really obvious that you've hit a loop, and secondly, the pitch will tend to sound slightly sharp or flat.

When you strike a key on a piano — excepting the lowest strings — you are actually setting two or three strings into vibration.

Here's a workaround to this problem that's particularly well‑suited to Ensoniq samplers, since they let you fine‑tune loop lengths in fractions of a sample. We can take advantage of this to get a looped piano sound that's a lot more convincing than the average single‑cycle loop. The basic idea is to create a copy of the piano waveform that only appears during the looped portion of the sound. This copy is 'tuned' so that if, for example, the original loop goes slightly sharp, the copy goes slightly flat. This creates artificial chorusing, thus minimising the timbral difference between the body of the sound and the loop; the equal and opposite pitch offset for the copy restores the sense of proper pitch.

Here are the step‑by‑step details:

1. Loop your piano sample by grabbing a single‑cycle wave as close as possible to the end of the sample. In most cases the further into the sample you go, the easier it is to find a good loop, but of course, this also uses up more memory. I've found that four to six strategically‑chosen samples can do a reasonable job of covering a five‑octave keyboard, but if you have the memory to allow more multisamples, by all means use them.

The most important point about this loop is to minimise the pitch variation as much as possible compared to the body of the sound. Be diligent and spend the time necessary to find a good loop point.

2. Create a copy of the looped sample and layer it with the original sample.

3. Move the copy's sample start point to just in front of the loop, so that the copy consists solely of a low‑level looped sound (low‑level because, remember, we're grabbing that cycle as close to the end of the waveform as possible).

4. Add a delayed attack, and then a slight‑to‑moderate attack time, to the copy's envelope, so that the the copy fades in a little bit before the main envelope's loop kicks in. There is one complication here: if you transpose the main sound over a fairly wide range because you don't have enough memory for lots of multisamples, the time it takes before the loop appears will increase at the lower end of the transposition and decrease at the upper end. Therefore, you will probably want the copy's envelope to track the keyboard so that the copied loop will come in at the appropriate time (i.e. when the loop on the main sample appears).

5. Tweak the copy's loop end point using the loop fraction parameter (the middle parameter on the loop end edit screen). If the loop on the main sample goes slightly sharp, increase the copy's loop length ever‑so‑slightly so that its pitch goes a bit flat to compensate. This tuning offset should be kept to a minimum, otherwise you may get some buzzing in the loop. This is why it's so important that the main sample's loop be as close to the correct pitch as possible — that way the copy's pitch doesn't have to be offset too much.

If you get the tuning just right, it's often possible to match the chorusing caused by the two loops interacting with each other with the natural chorusing that's part of the main sample. In some cases I've been astonished at how seamless the transition between the main body of the sound and the loop becomes. If you have a good sample to begin with and spend a lot of time getting the loop points just right (and of course, if the moon is in the right phase!), it can be very difficult to tell exactly where the looped portion begins in the overall sound. This is especially true if you can match the 'rates' of the chorusing on the natural piano sound and the artificial chorusing caused by the loop offsets.

This approach also works with other complex waveforms, such as 12‑string guitars — although I still think the best way to generate a 12‑string sample is to layer two 6‑string samples and add an octave tuning offset. But hey, that's another story for another time. Meanwhile, I hope you get a chance to check out this particular piano looping technique. It has worked really well for me.