You are here

Synthesizing Pan Pipes

Synth Secrets
Published August 2003
By Gordon Reid

Synthesizing Pan PipesBefore I ever touched a synthesizer, I played organs. Big ones, mind you... three-manual jobbies with 32-foot pipes that made a sound that you heard with your lungs, not your ears. And on these organs, there were numerous stops called 'flutes'. They sounded nothing like the instruments played by Ian Anderson and James Galway, but produced a softer sound than the strident brass stops, and a rounder one than the nasal reeds. With a following wind and a vivid imagination, you could picture them fulfilling a similar function to orchestral woodwind.

Later on, I bought my first synth and spent endless happy hours setting up the patches I found on the back of its four-page manual. One of these was, inevitably, a flute, but I could never get it to sound like the real instrument. As for the lovely, breathy sound of the pan flute, I couldn't come close. This was very disappointing, but I persevered because I knew that synths could produce good imitations of flutes... I had seen Genesis, and watched Tony Banks use an ARP ProSoloist to play Peter Gabriel's flute parts to remarkably good effect.

Figure 1: Energising a column of air in a brass instrument.Figure 1: Energising a column of air in a brass instrument.Nonetheless, my Korg 700, its replacement the MS20, and later additions such as the Roland SH1000 and SH2000 all failed to deliver, and it wasn't until I bought some rather sophisticated synths in the mid­'80s that I managed to conquer these sounds. So, in an effort to save you from my decade of frustration, we'll embark upon the Synth Secrets guide to synthesizing flutes.

The Principles Of The Flute

Figure 2: Energising the air within a flute.Figure 2: Energising the air within a flute.There are many instruments in the flute family, all of which use a sharp edge to excite a column of air in a cylindrical pipe. The family includes pan pipes, recorders, the Shakuhachi, and organ pipes, as well as the familiar orchestral flute and piccolo.

We can summarise the difference between these and brass instruments by referring to Figures 1 and 2, right. The first of these shows a brass player blowing directly into a pipe and establishing a standing wave, the frequency of which is defined by factors such as lip tension, blowing pressure, and the length of the pipe. Figure 2 shows a flautist exciting a column of air by blowing against the edge of a hole in a pipe.

Figure 3: Blowing a pan pipe.Figure 3: Blowing a pan pipe.You may think that these cases are similar to one another, but they are not. The physics of the directly blown pipe is quite different from the fluid dynamics and aerodynamics needed to understand and explain the flute. Consider the pitch and tonal changes available from over-blowing a flute, and the manner in which a skilled player can change the tone by altering aspects of the blowing angle and pressure, and it is apparent that something very complex is happening. What's more, it isn't even clear how the act of blowing across the gap creates a musical note. So let's simplify things by considering one of the earliest and most basic of flutes: a single pan pipe.

A Single Pan Pipe

Figure 4: Energising the pan pipe.Figure 4: Energising the pan pipe.Imagine you are blowing across the top of a bottle. Experience tells you that, if you get the blowing angle and pressure just right, you'll produce a breathy note that gets deeper in pitch the larger the bottle happens to be. The pan pipe — an instrument made from a cylindrical piece of bamboo and tuned to a particular pitch using a wax plug in the bottom — is the same. If you blow at the correct angle across the mouth of the pipe, you create what's called a 'flow valve'. Like a physical valve, this controls how the air flows into or out of the aperture.

Confused? Then imagine that there's already a standing wave in the pipe. At some point in time, the air at the mouth of the pipe is rarefied, and sucks in the air that the player is blowing across the top. A moment later, the compressed air at the mouth pushes outward, deflecting the player's breath. A moment after that, the cycle begins again. When the length and breadth of the pipe, and the angle and flow rate of the player's breath, are correct, the standing wave will form quickly, and it will exist as long as the conditions remain satisfied. (See Figure 4, above.)

Figure 5: The fundamental of a pan pipe.Figure 5: The fundamental of a pan pipe.To be honest, this is a simplified explanation, but it's satisfactory if we don't inspect the physics too closely. It then becomes simple to determine the pitch and tone of the note produced. Like the brass instrument in Figure 1, the pan pipe is closed at one end and open at the other, so it supports a standing wave with a fundamental wavelength twice the length of the pipe. However, whereas the brass instrument is closed by the player's lips and open at the far end of the pipe, the pan pipe is open at the energising end, and closed at the bottom. The waveform is therefore inverted, as shown in Figure 5, below.

Figure 6.Figure 6.Although this reversal of the open and closed ends makes no difference to the pitch of the instrument, the shape of the pipe differentiates it from any brass instrument and, as we shall see in the coming months, from some other woodwind instruments. The difference is this: a cylindrical bore closed at one end (a pan pipe) can produce only odd harmonics (see Figures 6 and 7, below). In contrast, a conical bore (brass) produces a full harmonic series. This means that the pan pipe shares its tonality with the family of waveforms that includes triangle waves and square waves whereas, as we have seen before, brass is better synthesized using the sawtooth waveform.

Figures 6 and 7: The 3rd and 5th harmonics generated within a pan pipe.Figures 6 and 7: The 3rd and 5th harmonics generated within a pan pipe.Inevitably, things are not as simple as this because — as I've mentioned before when we've discussed pipes — the wavefront overshoots the end of the pipe by a small distance, so higher modes of vibration become progressively inharmonic. What's more, you can affect the nature of the vibration by covering a proportion of the aperture (which allows the player to bend notes) and by changing the air flow (which makes possible a wide range of breathy timbres, and the instrument's characteristic percussive sounds).

Enough Of The Theory... Yes?

Despite these complications, it seems that the pan pipe is, essentially, a generator of square waves or something similar, so we should be able to imitate it using the simple synthesiser architecture shown in Figure 8 (right). Unfortunately, this doesn't work. The result sounds like a contoured square wave, and nothing like the real instrument.

Figure 8: A simple synthesizer for generating sounds based on square waves.Figure 8: A simple synthesizer for generating sounds based on square waves.If you listen to a pan pipe (or, for that matter, a blown bottle) the major reason for Figure 8's timbral inadequacy is obvious. Despite the seeming thoroughness of the analysis above, the real sound has a very strong noise component. This is a consequence of turbulence.

Let's digress for a moment, and consider one of those TV adverts from the 1990s that showed the air flowing over the body of a car. As the adverts explained, a smoother air flow offers benefits such as improved fuel economy and lower noise in the cabin. If anything disturbs this ideal flow, turbulent vortices appear. These create drag that slows the vehicle, make it less fuel efficient, and make the cabin considerably noisier.

Figure 9: A spectrum resulting from adding low amplitude white noise to a square wave.Figure 9: A spectrum resulting from adding low amplitude white noise to a square wave.Even a small amount of turbulence can generate a considerable amount of acoustic noise, as you will appreciate if you stand underneath a jet aircraft as it takes off. Likewise, the turbulence in a musical instrument will add a strong noise component to its sound. Not surprisingly, given our observations of the real instrument, the excitation method — blowing against an edge — is a superb mechanism for generating turbulence within and outside the pipe, so we must expect the resulting spectrum to comprise a square wave plus noise, as shown in Figure 9.

Nevertheless, adding a noise generator to Figure 8 (see Figure 10) proves no more satisfying than the earlier patch. The square wave and the noise seem to be disassociated from one another, and this sounds wrong.

Figure 10: Mixing a square wave and noise to try to generate the pan pipe sound.Figure 10: Mixing a square wave and noise to try to generate the pan pipe sound.Listen again to the pan pipe, and you will hear that the tonal part of the sound and the noise are not independent of one another. The noise has a breathy quality with a distinct pitch related to the note being played. This is not surprising. The turbulence occurs within the pipe and at its boundaries, so it must be coloured by the acoustics of the pipe itself.

Listening even more closely, it's apparent that the tonal part of the sound is not rich in high-frequency harmonics. In contrast, the noise is most audible at higher frequencies. This means that we have a spectrum that is more like Figure 11 (below), with strong, low harmonics accompanied by a halo of noise, and higher harmonics that are masked by broad, noisy bands of frequencies.

Figure 11: Turbulent noise tuned to the harmonics of the pipe.Figure 11: Turbulent noise tuned to the harmonics of the pipe.We can synthesize this. Although few, if any, subtractive synthesizers offer 'blue' noise sources (in which high frequencies predominate) it's easy to patch this: send a white noise source through a gentle high­pass filter. You can then pass the result through a formant filter bank tuned to the harmonic frequencies of the note produced by the pipe. Hmm... this is non-trivial.

Apart from the tuning itself, we will need as many formants as the square wave has harmonics. For a note close to middle 'C', we need filters for approximately 250Hz (the fundamental), 750Hz, 1,250Hz... and so on up to 20,000Hz. That's 40 band-pass filters! Fortunately, experience shows that just six bands on the edge of self-oscillation, tuned to octaves and fifths, provide an excellent 'breathy' sound that fulfils our purposes admirably.

Figure 12: Tuning noise to the square wave harmonics.Figure 12: Tuning noise to the square wave harmonics.I have drawn this in Figure 12. Now let's listen to the real thing yet again, and try to determine how the parts of the sound are developing...

The first thing we hear is a noisy 'chiff' that sounds independent of the tone and the breathy noise that we just created. Skilled pan pipe players make great use of this, and it is perhaps the most defining characteristic of the instrument. Consequently, we need to add a chiff. We do so by tapping the filtered noise before it reaches the formant filter, and passing this through a low-pass VCF and a VCA, both of which are controlled by an AR contour generator. (See Figure 13 below.)

Figure 13: Patching a 'chiff'.Figure 13: Patching a 'chiff'.

After the chiff, the noise settles into its quasi-tonal form, so we need to control the amplitude of the output from the formant filter bank, and mix this with the chiff. Ideally, one would do this using an independent VCA and another contour generator, but in the interest of simplicity I am going to use a single ADSR contour generator as patched in Figure 14 (below). This works because I can set the cutoff frequency of the 'chiff' filter to pass signal only during the A and D phases of the contour. Neat, huh?

Figure 14: Creating the chiff and breathy elements within the sound.Figure 14: Creating the chiff and breathy elements within the sound.

Set The Right Tone

Now let's return to the tonal element of the sound. We know that this has only odd harmonics, so we need to start patching using a square wave or triangle wave as the oscillator's output. We also know that we must filter the harmonic content to be akin to that of the real pan pipe. This means that it must be fairly mellow, so we place a low­pass filter in this signal path.

Figure 15: The contours for the noise signal and the pitched signal.Figure 15: The contours for the noise signal and the pitched signal.Listening to the original instrument yet again, you'll notice that the tonal sound does not begin immediately, but swells up after the chiff and after the tuned noise becomes apparent. We could imitate this perfectly with one of Korg's HADSR (Hold-Attack-Decay-Sustain-Release) envelopes, inserting a tiny delay before the onset of the Attack phase. Unfortunately, few synths have these envelopes, but we can get away with a simple ADSR if the Attack value is carefully chosen. Figure 15, right, shows how the two contours combine the wave and the noise into the composite sound.

Refining the pitched sound still further, a bit of modulation wouldn't go amiss, so we'll add an LFO to create vibrato, and then a wheel to control its depth. In fact, let's go the whole hog, and patch some vibrato, tremolo and a little bit of filter modulation simultaneously. But, contrary to everything we have learned about natural sounds, we'll invert the amplitude modulation so that, as the filter opens, the gain is reduced, and vice­versa. This seems odd, and I wouldn't have tried it had fellow SOS contributor Nick Magnus not bullied me into it. Nevertheless, it seems to work well, keeping the total amplitude steady as the filter opens and closes. I have shown all of this — the filtered square wave, the envelope, and the modulation — in Figure 16.

Figure 16: Shaping and modulating the tonal elements of the sound.Figure 16: Shaping and modulating the tonal elements of the sound.Figures 14 and 16 contain almost everything we need to produce the single note produced by one pan pipe. However, a single note is not of much use unless you're into minimalist Andean avant-garde music. So we need to add some control signals that will make the patch work over a range of notes. We'll provide these from a conventional CV+Gate keyboard, but keep the following points in mind as we patch it in.

Firstly, it's vital that the oscillator in Figure 16 and the formant filters in Figure 14 track the pitch CV together. If they do not, the two elements of the sound will disassociate, and ruin the illusion.

Secondly, it's important that the keyboard offers multi-triggering. This ensures that the chiff occurs at the start of every note, even when you play legato.

Thirdly, I'm going to add an attenuated pitch CV to open the filter in the lower signal path, allowing us to make the signal brighter as the pitch rises, but not necessarily in a 1:1 relationship. This is, of course, variable keyboard tracking.

Next comes something we've not tried before in Synth Secrets, and I'm again indebted to Nick Magnus for suggesting it. If you refer back to Figures 9 and 10, you'll remember that the oscillator signal and the noise signal failed to form a composite sound. We overcame this in Figure 14 by tuning the noise to the harmonics of the square wave, but we can do even better.

Applying noise to the CV input of the low-pass filter shaping the square wave signal adds a rough edge to the sound. It's noise, but with a very different character to that obtained by adding audio-signal noise using a mixer. What's more, you can manipulate the tone and amount of this noise using a graphic EQ or 'fixed filter bank', so that it sculpts the sound in desirable ways. If you make sure that the noise in this part of the patch is at predominantly high frequencies, and apply just a little to the filter CV input, it works a treat.

Right... now we're ready for Figure 17.

Figure 17: The pan pipe patch.Figure 17: The pan pipe patch.

Despite these refinements, the sound is still somewhat artificial in nature. With a MIDI keyboard that accepts a breath controller, plus a suitable MIDI/CV converter, you could animate the patch in ways that are not possible with envelope generators and LFOs. You could improve matters even further by replacing the keyboard, modulation wheel and breath controller with the Ondes Martenot discussed last month. What do you mean, you don't have an Ondes Martenot? Oh well, there's another good solution...

Figure 18: Using a joystick for added realism.Figure 18: Using a joystick for added realism.

In the hands of a skilled player, a real pan pipe exhibits a great deal of pitch bend, as well as vibrato and tremolo. So — instead of using an Ondes Martenot or breath controller — our final development involves replacing the modulation wheel with an X/Y joystick, and patching it so that the Y axis provides control over modulation depth and the X axis provides pitch bend. For clarity, I have shown the relevant part of the patch in Figure 18, above, and incorporated it into the final diagram, as Figure 19.

Figure 19: One more time, with feeling.Figure 19: One more time, with feeling.

If you've set the controls of each module appropriately, this patch now sounds very much like a pan pipe. In fact, it sounds more like a pan pipe than I would have thought possible before I developed it. It's true... Figure 19 is not just theory; I created it using one of my analogue modular synth systems, and it sounds superb.

But you can go still further. For example, if you're programming on a modern computer-based software-synth package such as NI's Reaktor, or a hardware/software system like Clavia's Nord Micro Modular, you can make the attack velocity sensitive, which proves to be another huge improvement. You could also patch the joystick's pitch bend to amplitude, and there are other flourishes that would add performance and realism to the sound. But, however you choose to complete the patch, just add a judicious sprinkling of reverb and... hola, amigos!

Epilogue

I have looked through the patch books supplied by ARP, Moog, Roland, Korg and others, and despite a wealth of flute patches, I could find no pan pipes. Yet here we have a remarkable patch that requires just four voltage controlled filters, a formant filter, a fixed filter bank, an oscillator, a noise source, seven VCAs, four contour generators, a bunch of mixers and multiples (which I haven't even shown), a joystick, and... Ah yes, I see the point. Pan pipes may be straightforward to synthesize in software or on something the size of a small wardrobe, but their instantly recognisable 'breathy' sound is not going to emerge unscathed from a Minimoog, Odyssey or SH101. Nonetheless, orchestral flutes pour forth from basic synths. Despite the increased mechanical complexity of the flute, its sound must be simpler than its predecessor, the pan pipe. So, next month, we'll create some patches that you'll be able to try on almost any synth. Until then...

Published August 2003