Shepard Function (Barberpole) CV generator Reprinted from: "Lab Notes: Shepard Functions", by John Simonton, Polyphony magazine 2/83 see accompanying files: shepard.gif for figures 1-7 shepard2.gif for figures 8-11 The first audio illusion I ever heard was the Shepard Tone. Maybe you know it by the more descriptive term "barber pole" tone. It got that name because, like the stripes on a barberpole it seems to defy the old saw "what goes up must come down". The effect is that of a continuously rising (or falling) tone which never resolves. How the Shepard Tone works There is nothing very mysteryous about the Shepard Tone, as disconcerting as it can be at first, and if you've worked with synthesizers for a while you can figure out pretty quickly what's going on. The spectrum of the tone consists of a large number of harmonically related components, all stepping up-scale together. The harmonics at the high and low ends of the spectrum have relatively low amplitudes, while harmonics in the middle of the tone are at maximum amplitude. Imagine for a moment that you are following the lowest harmonic that makes up the Tone. At first the amplitude of this component is so low that it is, for all practical purposes inaudible. But as it steps up-scale its level increases, peaking when its frequency corresponds to a point midway between the high and low limits. After peaking, the amplitude decreases as the frequency continues to step higher until finally, at the upper frequency limit, the harmonic is again inaudible. When the harmonic reaches the high frequency limit it disappears, only to be replaced by a new harmonic at the lower limit. Since the eight or ten harmonics which make up the Tone are all rising in a "staggered" progression, each in turn starting over again as it reaches its upper frequency limit, the overall effect is that of a tone which is constantly increasing in pitch while not actually getting any "higher" (or lover if the tones are all falling). It's an interesting illusion. Roger N Shepard's original work used a computer program written by Max Matthews but the same type of effect can be accomplished using analog synthesis equipment controlled by a gadget which, for lack of a better name, we may as well call a "Shepard Function Generator". The Shepard Function Generator. Thinking about what happens with the frequency and amplitude of each harmonic of a Shepard Tone makes it easier to understand the composite sound. The frequency increases constantly and linearly from low to high, until the higher limit is reached. At this point it begins again at the lower limit. This is a ramp function. The amplitude of any harmonic increases from the lower limit until it reaches the middle frequency and then decreases as it approaches the upper limit. This can be a triangle function. So, we need a gizmo which will produce a bunch of ramp waveforms (eight is a convenient number), and an equal number of triangle waves. The ramps and triangles both must have fairly precise phase relationships to one another, as summarized in the diagram in figure 1. In the interest of conserving drawing time and space, I have shown only four of the eight functions pairs that our device will generate. I'm sure that you can see the patterns and that the missing odd functions fit between the even functions that are shown. Notice that each function pair in the complete series in 45 degrees (pi/4 radians) out of phase with each of its neighbors. The even pairs shown are 90 degrees out of phase with one another. Now, there are almost certainly lots of possible analog ways to generate these function pairs. but the simplest circuit I can think of to do this are *too* simple (for example, they wouldn't be able to generate the functions over a very wide frequency range), and what complicated approaches come to mind are *very* complicated. But I know of some workable digital approaches and I'd like to show you one, a discrete logic machine. The day will soon be here when we wouldn't even discuss a logic machine approach to this problem. We would just truck ourselves down to our local electronics store and pick up a blister packed Single Chip Data Processor to be programed on our trusty Home Data System. No doubt, but let's look at a way to do essentially the same thing with counters, DACs, MUXs and such ... things we can get today. figure 2 shows some components which we'll use in the Shepard Function Generator (as you probably realize, a counter connected directly to a DAC generates ramps). If the counter is counting up, upward sloping ramps come out. Having the counter count down, or inverting the counter output before it gets to the DAC, produces downward ramps (see figure 3). Consider this: A triangle may be thought of as a ramp which changes its mind halfway up. If we replace the inverter in the figure above with Exclusive-OR gates, we can produce a single logic input that when high, causes the DAC to produce an upward ramp and when low, causes a downward ramp. By using the most significant bit of the counter as the control signal to the EX- ORs, the digital input to the DAC will count up until the MSB goes high, then it will count down -- in other words, a triangle function (see figure 4). If we're interested in generating only a single function pair, it's a simple matter to pick up a new Least Significant Bit on the counter and use it to effectively switch back and forth between the circuitry of figure 3 and 4, producing first a small section of the ramp, and then a small section of the triangle. This new LSB also switches between two sample-and-hold circuits to de-multiplex the composite output of the DAC. Figure 5 shows how a little more logic gives Fr(0) and Ft(O). I'm sure that we're together so far, and to make lure that we stay together I should mention a useful way to think of the eight Most Significant Bits of the counters. Think of them as phase, summarized in Table 1 below. TABLE 1 Counter Output equivalent Phase binary hex 0000000O - $O0 0 degrees 00100000 - $20 45 degrees O100000O - $40 90 degrees 01100000 - $60 135 degrees 10000000 - $80 180 degrees 10100000 - $a0 225 degrees llooOooo - $co 270 degrees 11100000 - $eO 315 degrees If you're more comfortable with a graphic representation, see figure 6. The benefit at thinking of the counter data in this way is that phase shifts are produced by simple additions. For example, to shift the phase of the waveforms produced by the counter and DAC by 45 degrees, simply add $20 to the output of the counter. This is a pretty handy thing to know, particularly when it just happens that we are looking for a way to generate eight sets of functions which are 45 degrees apart. Figure 7 shows a block diagram of the complete Eight Phase Shepard Function Generator which results when we include an added IC to calculate digital phase offset, and de-multiplex the output with 8/1 analog switch ICs; figure 8 shows the schematic to the complete Shepard Function Generator. In the same way that the circuit of figure 5 alternately generated pieces of Fr(0) and Ft(O), the Shepard Function Generator sequentially puts out pieces of Fr(0), Ft(0), Fr(1), Ft(1), Fr(2) ... Ft(6), Fr(7), Ft(7). Details: Starting from the Most Significant end of the counter, the first eight bits of the counter serve the same functions that they did in the warm-ups. And we've decided to think of that function as phase. Unlike the previous sketches, these ph ase bits are broken down into two groups: the three Most Significant and the next five. If you don't see the significance of this grouping, review the binary representation in Table 1. To produce 45 degree phase shifts, the three Most Significant Bits are the only ones which change. Below the eight phase bits you'll see another grouping of three bits. Think of these as "offset" bits, and notice that they are what's added to the three Most Significant Bits by the adder. And note that the offset bits also serve as address bits for the De-Muxes so that any given phase offset always gets strobed into the same sample-and-hold. The next "Less Significant" bit can be thought of as switching back and forth between ramps and triangles, as in figure 5. And since figure 7 is a block diagram of our working Shepard Function Generator, and not just theoretical like the previous figures, the Least Significant Bit of the counter serves as a strobe which allows time for the DAC to settle before selecting a sample-and-hold. So, the SFG we've developed isn't simple (though I would like to think it has a certain elegance) and when you consider that we'll also need eight VCOs and eight VCAs to produce the Tone (see figure 9), you might question if it's really worth the has sle. But Shepard Tone generation is not the only application for this circuit; recently the same principles have been applied to other areas of electronic music. For example, the Barberpole Phaser invented by Harald Bode in a signal *processing* device which substitutes phase change components applied to an external signal source for the frequency components of the Tone. The characteristics of multiple phase shifters are controlled by Shepard Functions so that the phasing effect doesn't simply swing back and forth, like we're used to hearing, but rather sweeps up or down eternally. It's really a most unusual effect and if it has occurred to you that the same principle might also work with other processing elements (such as filters) you're on the right track. Figure 10 is the configuration such approaches would customarily take, with the ramp functions controlling the parameter being modified (phase, corner frequency, time delay, etc.) and the triangles controlling VCAs to fade the output of the modifier in and out. You may have noticed that we're Using gobs of equipment ... lots of phasers or fIangers or whatever. Chances are that you don't have eight flangers laying around. Even if you use the least expensive modifier available (PAIA's EKx module series, for example) you will still have some bucks tied up in repetitive elements. Wait, We're being prejudiced by what we've seen so far (always a danger). We're thinking of the Shepard Function Generator only as a way to generate monophonic, non-cyclic illusions by always using all 16 output functions to control 16 corresponding processing elements. But that's where we're getting off the track. You don't have to use all the outputs all the time, and the results don't have to be monophonic. Now, there's no doubt that eight phase Shepard Functions are the minimum number of components which will still preserve the "barber pole" illusion, but there are other times when sets of phase synchronized functions are useful. Is it obvious that any pair of triangles 180 apart -- Ft(0) and Ft(4), for instance -- may be used with a pair of VCAs to give automatic stereo panning? Or that four triangles 90 degrees apart provide quad panning? With the arrangement shown in figure 11, the apparent "revolution" of the sound source is clockwise To reverse the apparent direction, reverse either pair of corner sources. Various combinations of triangles with unequal phase relationships may be used to produce effects which don't just swing round and round, but rush out of one of the "corners", swing around in front of (or behind) you to disappear into the other corner. When you start adding effects into this setup (such as phase shifters) under control of the ramps, the sound really begins is move around you in some strange ways. A nice thing about this is that the effects devices don't all have to be the same to produce interesting results. In fact, some of the most interesting results come from using completely different effects (such asphaser and echo) in opposite corners with only VCA processing on the other corners. While you might be hesitant to rush out and buy eight CVOs just to get a tone you probably have enough modules or effects to get started. Voltage control is obviously preferable, but even effects which have only manual control are useful. Among other things, be sure to try synchronizing the frequency of the effects oscillator to the frequency of the Shepard Function Generator. I think you get the idea: Play.. Try different effects and different functions applied to different effects. Try controlling the VCAs With the ramps and the effects with the triangles -- try leaving out the VCAs altogether Not all of the results will be particularly pleasant, but you will surely also find some that are unique beyond words. While many of these effects are somewhat less spectacular when done in stereo, they are still very effective. (c)1995 PAIA all rights reserved Fair use copy with this notice only for further infomation contact paia@aol.com