Saturday, July 16, 2011

EML 101 repair -- reference voltage circuit

The EML 101 on its test fixture on the workbench.


I wrote in my previous entry (before unemployment and tornado disasters intervened) that I have not been able to get the EML 101 to scale. I think I figured out why. The 101 has a circuit that generates a 4.4V reference voltage that several other circuits, including the expo converters, use as a standard for developing other control voltages. Here is the circuit in question, from an old set of photocopied schematics:


The zener diode at the left, marked 1N823A, is supposed to have a reverse bias drop of 6.2V. The two resistors to the right of it comprise a voltage divider that drops this down to the 4.4V reference. That is filtered by the cap and fed to the 741 configured as a unity-gain buffer.

I had to hunt around for where this circuit physically was. I knew from a legend on the schematic page (not visible in the scan above) that the circuit was on board #1, the expo amp board. In the photo below, showing the reverse side of the panel, board #1 is at right, just to the left of the power supply:

EML 101 guts. The power supply is at farthest right, then the three main boards are numbers 1 thru 3, right to left: the expo amp board, the oscillator board, and the filter/VCA board. In this photo, the expo amp board has been detached from its standoffs for ease of access. The rear of the patching jacks can be seen across the top.

I figured it had to be near one of the 741s on the board, but I was confused at first because I didn't know what the 1N823 actually looked like. There were many ordinary glass-bodied ordinary diodes on the board; I figured it didn't look like those, but I wasn't sure what I was looking for. The data sheets I found for the 1N823 were no help because none of them had an actual photo.

I finally focused my attention on what appeared to be an oddly-marked resistor at the lower right edge of the board. In the photo below, the screwdriver points to the vicinity:



I had been looking at this "resistor" because the marking didn't make any sense. If you double-click on the photo below to expand it, you can see that it is marked sorta-blue, red, orange, and then a blue T that points towards the right end. It finally dawned on me to decode the stripes: if you allow that the sorta-blue might have been gray 35 years ago, they spell out "823", the part number of the zener I was looking for! I've never seen a diode marked like this. The blue T points towards the cathode end. Sure enough, this was it. The 2.2K and 5.6K resistors are right above the zener; the 1K resistor is to the left, and the round metal thing that appears in this photo to be a four-legged transistor is the 741. (This is how ICs were packaged in the early days, before the DIP package came into use. The other four legs of the 741 are obscured by the green wire.)


The 4.4V reference circuit. The "708" stamped into the board is this 101's serial number. This photo was shot through a 2X inspection magnifier. The finger is not part of the circuit (hopefully).

I measured the voltage across the zener and got 6.39V, higher than the spec'ed 6.2. Doing the math with this input voltage, I got 4.6V for the voltage divider output, which, sure enough, is what it measured. I considered replacing the zener, but researching the 1N823 further, I noted two things about it: (1) it is a temperature-compensated part, and (2) it appears that the only present-day suppler is NTE, and Mouser has it marked "not recommended for new designs", which suggests that it may not be in production much longer. And there doesn't seem to be an exact current-day substitute. So I figured that as long as the one that's there is still working at all, it would behoove me to find a way to make the circuit work.

The obvious answer is to tweak the voltage divider by replacing one of the resistors. I did the math for what value I would need in place of the 2.2K resistor, and I got 2.53K. Off to the Mouser catalog to see what they had in the way of 1% resistors. 2.53K isn't an available value; the two closest are 2.51 and 2.55K. So I ordered 10 of each, and I'll measure each one to see which one gets closest to the 2.53K value I need.

I've got the shipment now, and next week I'll replace the resistor. And then we'll see if my grand theory is right: that the 4.4V reference being off by 0.2V is what is preventing the 101 from playing in scale.


Tuesday, April 26, 2011

EML 101 and MIDI

I've had several people asking me how I got a MIDI interface to work with my EML 101. I haven't answered the question yet because... well, to tell the truth, I don't remember exactly what I did, and unfortunately I can't remember which forum I posted the article where I did it. And Google isn't turning up anything.

I have the 101 on the bench now for calibration. While I've got it out, I'll reconstruct the mods that I made in order to be able to input a control voltage and gate. One thing I have to point out: I did not mod my 101 so that it will work with 1V/octave scaling! Several years ago I purchased a JKJ Electronics CV-5, which is scalable to the 1.2V/octave EML scaling, and that's what I use. Unfortunately the CV-5 is now out of production. I don't know whether other MIDI interfaces on the market can be scaled to 1.2V/octave or not. However, it would not be too hard to build a little circuit that would re-scale a 1V/octave control voltage to 1.2V/octave. I'll draw up one and post it.

It will probably be a few days because... now that I have my 101 on the bench, I can't get it to scale with its own keyboard. The linearity and scaling trim pots are all on the stops and it's still not close; I'm only getting a span of about 2 octaves across the keyboard. The really odd thing is that it's happening on both the KB1 and KB2 busses, which are almost totally independent circuits. Tomorrow I'll start by checking the 4.4V internal reference voltage.

Sunday, April 24, 2011

Review: Oakleysound EFG envelope follower

I recently purchased an Oakleysound EFG, pre-assembled from Krisp1 in the UK. (Oakley itself does not sell assembled modules.) This is a combination preamp, envelope follower, and gate generator. The module was on sale for (if I recall correctly) £110, which after exchange to American currency and shipping, worked out to a total cost of $195 US. Shipping time was about a week, and the module arrived well packed and protected.

This particular assembly is based on the issue (version) 4 board from Oakley. The one I bought is formatted as a 1U width MOTM-format module:


Oakleysound EFG, as assembled by Krisp1. Note that this panel layout is different from the 1U panel shown on the Oakley Web site.

What is an Envelope Follower?

So what is an envelope follower? Well, you know what an envelope generator is. It creates a signal whose (primary) purpose is to represent the volume of a sound over time; the signal is intended to be used as the control input to a VCA. An envelope follower, rather than creating an envelope from scratch, accepts an audio input and then outputs a control voltage that is proportional to the volume of the input audio at any given moment. The louder the volume of the input signal, the higher the control voltage output.

The Oakley EFG also contains a gate generator, that turns on when the input signal rises above a set level, and turns off when it drops below that level. For instance, as an alternative to having a VCA track the input level of your source, you could use an envelope generator connected to the VCA to re-shape the input signal's envelope. For this, you connect the EFG's gate generator output to the gate input of your envelope generator. The EFG's gate serves as an alternative to the normal gate signal that you would get from a keyboard connected to the synth.

EFG Features and Controls

An obvious application of an envelope follower is to make a VCA follow the envelope of some sound produced externally from the synth, such as the sound of a conventional instrument picked up from a microphone or electromagnetic pickup (e.g., electric guitar). These instruments and devices produce signal levels that are far lower than the signal levels used in a modular synth. Towards that end, the EFG incorporates a high-gain, high-impedance preamp, into which you can plug in a dynamic microphone, a self-powered condenser microphone, or an electric guitar/bass directly. The preamp has a very wide gain range, so that it can also accept line-level signals. It provides its output directly to the envelope follower's input; the preamp output is also available directly at a panel jack. A red "PEAK" LED on the panel indicates the onset of clipping in the preamp.

The envelope follower itself follows whatever signal is input to the preamp. A green "FOLLOW" LED on the panel lights up to indicate the control voltage being output; brighter indicates a higher voltage. This version of the EFG provides only one control for the envelope follower itself: a panel switch that selects slow or fast tracking. (Apparently the board can accommodate a pot that allows the envelope generator tracking speed to be varied.)

The gate generator outputs a gate signal that indicates the presence of a signal at the audio input. The gate is at 5V when a signal is present, and at ground when the signal is absent; this is pretty much the standard for modular gear. (It might or might not work with other synths; for instance, it won't work with Moog or Yamaha gear without conversion circuits.) The yellow "GATE" LED lights when the gate is active. The primary use of the gate is to control an envelope generator, in the same way that a keyboard gate does. You could then use the envelope generator to re-shape the audio signal. For instance, by setting your envelope to a fast attack, slow decay, and zero sustain level, you could make an instrument that sustains indefinitely (say, a saxophone or a violin) fade out like a piano.

The THRESHOLD control on the panel determines the level that the input signal has to reach in order to be considered "active". The RESPONSE control adds hysteresis to the threshold level; as you turn the control to the right, the turn-on level goes higher while the turn-off level goes lower. You can use this sort of like a noise gate. If your input signal is a source that fades out gradually, like a guitar or piano, you can set the control to a slow setting so that it the gate remains active for a time after the signal fades below the turn-on threshold. It helps prevent the gate from thrashing back and forth when the signal level is near the threshold. I found that when using an electric bass as the source, I had to set this to a high value to prevent the gate from chasing the waveform; in other words, turning on and off with each cycle of the waveform.

Using the EFG

I tried several things with the EFG. My first patch was to plug an electric bass into the EFG's audio input. I routed its audio output to an MOTM-190 VCA configured as a ring modulator, and fed the output of a VCO to the 190's other input. The output of the 190 went to a Dotcom Q109 VCA which served to actually control the level of the output signal.

I started by connecting the EFG's control voltage output to the Q109's control input. With this configuration, I could play the bass and have its output ring modulated against the VCO. The output from the Q109 tracked the envelope of the bass, so that notes played on the bass attacked and decayed the same as if I were playing directly through an amp. That worked well with the envelope follower tracking switch on SLOW; when I put it on FAST, the envelope generator chased the waveform somewhat. That was actually kind of interesting, but not what I was wanting at the moment.

Next, I plugged in an electric guitar. With the MOTM-190 still configured as a ring modulator, I unplugged the control voltage output from the Q109 VCA. I then plugged the EFG's gate output into a Q108 envelope generator, and plugged its output into the Q109. I was able to obtain steel-drum-like sounds by setting the envelope for minimum attack, short decay, and zero sustain. With a longer attack and high sustain level I could get things that sounded like radio interference, or detuned violins; it helps if you turn the RESPONSE control up so that the gate remains active long enough to reach the sustain phase. One thing that doesn't work is to set up for a long release and then mute notes on the guitar: no matter what you set the envelope generator release to, the VCA can't amplify a signal that isn't there! That's one thing you have to get used to when you use an instrument with an envelope follower.

I did find that it was rather difficult to set the THRESHOLD control to get the gate to behave exactly the way I wanted. With a moderate setting of the RESPONSE control, the threshold range between the point where the gate would go off too soon, and the point where it would stay on indefinitely due to noise picked up by the guitar, was pretty small -- between the 2 and 3 positions. Turning the gain up helps some, but then you get into clipping in the preamp section. If I were seriously going to use the guitar as an input to the EFG in a patch, I'd probably put a compressor in line ahead of the EFG.

Technical Details

The EFG circuitry consists of a single board, mounted at a right angle to the panel and secured to it via the three pots, in the style of most MOTM 1U width modules. The build quality is excellent; the soldering is very clean and the leads to the panel-mount components are nicely dressed. The board came equipped with the MOTM 4-pin power connector; there is also provision on the board to install a Dotcom power connector. A MOTM-style power cable, with latching connectors, was shipped with the module.


All ICs are socketed, for easy replacement if needed. The board has ferrite beads to clean up in the incoming power, and diodes to protect against the power cable being plugged in backwards. I couldn't figure out what brand the pots are, but the feel is smooth and I didn't notice any glitches when turning the knobs. The jacks are Switchcraft enclosed jacks, which are top-quality parts.

I did some tests to look at what kinds of voltages were coming out. For the envelope control voltage, with no input, the output is at zero volts, as you might suspect. I set up an input signal and varied the gain so that it was just below the point where the PEAK light comes on; at this level, the envelope follower outputs 6 volts. It will go higher, past 10V, if you let the input stage be overdriven, but of course at this level the preamp's audio out won't be very useable.

The gate outputs 7V when active, and I verified that it will gate an Encore Electronics universal event generator (a module that is known to be picky about its gates). With the gate THRSHOLD and RESPONSE controls set full counterclockwise, the gate threshold occurs at the point where the envelope follower is outputting about 1 volt.

The board has two unused features which could be exploited. There is a provision to add a lag control to the envelope follow control voltage. Also, by cutting a jumper, the preamp section can be separated from the input to the envelope follower and gate generator circuits, which would allow one to use the preamp for an instrument and then put its output through additional processing before inputting it to the follower.

Conclusion

To be honest, I had not previously considered buying any of the Oakley/Krisp1 modules solely because of the sucky (for Americans) dollar/pound exchange rate, which meant that a similar module from a North American source would nearly always cost significantly less. But when Krisp1 had their close-out sale on this module, I couldn't resist. I'm glad I made the purchase. This is going to be a very useful module, both for running conventional instruments through the modular, and for interfacing the modular to other synths. For instance, I could run the output of a polysynth into the EFG and use the control voltage output to control the cutoff of a VCF, adding an envelope-filter capability to the polysynth. Or, using the EFG in combination with a waveshaping circuit, I could make an approximation of a guitar synthesizer. My only comment is the small useable range of the gate THRESHOLD control. Other than that, it's a great module.

Sunday, April 17, 2011

Remove Before Flight: the making of a trance track

I've been wanting for a while to take a shot at an electronica track. I wanted to do it as a new challenge to myself -- I've listened to lots of electronica, but have not tried writing any before -- and as a way of putting some rhythm and melody back into my music. I've been doing a lot of atonal experimental stuff lately and I needed to get back in the groove, figuratively and literally. Here is the result, from my Web site.

The Web site writeup describes the who-did-what for this track, but I wanted to go a bit more into the decision-making process here. Remove Before Flight started out as a drum pattern. A very complicated, cluttered drum pattern. I started with a low tom (not a kick; more on that in a moment) hammering a 4/4, and added drum after drum until I had, well, a mess. Then I started taking stuff back out. I kept doing that until I had a recognizable pattern. The snare and cymbal play a bit while the tom keeps the beat pinned down. One thing I quickly recognized about it is that there is no obvious place for the "one" beat. When I put together the place where the first heavy pad sound comes in, I realized that I had started it on the wrong beat! I went with it, and there are several places in the track where "one" gets redefined, although it isn't glaringly obvious.

I had several specific things that I wanted to do with this track: (1) get the Kawai K5m involved; (2) build a modular patch involving the MOTM-510 WaveWarper; (3) experiment with Shepherd tones; and (4) put together an idea that I've had laying around for a while called the "drum console". The first two sounds that come in after the drum pattern starts -- the bass and electric-piano-like chords -- are both out of the K5m. I've done some stuff with the K5m before, but like a lot of people, I always found the additive synthesis method hard to get a feel for. However, after doing the Mississippi Statescape entirely with additive synthesis (albeit using the simpler Minky Starshine plug-in), I felt like I was ready to take another crack at it.

I started with a patch that I had built previously for part of Solar Flare. I tweaked on that, looking for an interesting melody patch, but it turned out to work better as a bass patch. Then I created another patch for the pulsing electric-piano-like sound. I recorded both of these as virtual tracks, so when I did the mixdown I had to put the K5m in multi mode, which I've never used before, and take the two patches out of separate outputs. And by doing that, I discovered something: the K5m is a lot quieter in multi mode! I'm not quite sure why this is; I think the K5m sums all five outputs together when it's in single mode. The K5m is known for being rather noisy; I've done the mod on mine to increase the output levels, but it's always tough to get the gain staging with it set up right. But from now on, whenever I record the K5m, I'm going to use the multi mode even if I'm only using it monotimbrally. (I found out something else interesting: in the multi mode, you can decide how many voices to allocate to each patch! I don't know of any other synth that lets you control the voice allocation in multitimbral operation this way.) Using poly mode 2 chops off the release phase of each note when the next note starts, giving more of a feel of a monosynth without using the 106's notoriously odd-sounding unison mode.

The high-pitched thing that sort of sounds like a pipe organ is from the JD990. Except for at the beginning, this is always layered with a big pad patch from the Matrix-1000. This turned out to be a good combination, with the somewhat shrill patch from the JD990 layered with the bassy and rather muddy Matrix-1000. I created the 990 patch specifically for this; the M1000 patch is one that I've had laying around. There are several things in the M1000 patch that are modulated by aftertouch to produce a somewhat unsettling detuning effect, which you can hear as the "chorus" portions of the track trail off into the quiet parts. It's a great demonstration of the M1000 modulation matrix.

The track actually uses three different bass patches. I started out with the K5m bass in the quiet parts, but I decided it was too up-front. I remember a patch that I had put together on the JD800 to emulate an electric bass. The basic patch is two layers; I had defined it with a third, disabled layer in an attempt to emulate an 8-string bass. That didn't really work out, but playing it way down at the far left end of the keyboard, it made a great near-subsonic bass for the quiet bits of this track. I knew that neither the K5m nor the JD800 basses would work as the sustained bass that I needed for the big choruses, so for that I created a third bass patch using the V-Synth. This patch has the ability to vary the low end harmonic content using the panel performance knobs (and corresponding MIDI CC #'s), which I use at the final chorus part. I mentioned using a low tom instead of a kick in the drum pattern. I did that because I knew I would be using a deep bass patch at some point in the track, and I don't like a kick drum cluttering up the bass spectrum. My observation is that when you do a track like this, you have to make a choice -- either use a deep kick and keep your bass patch in the mid-bass region, or use a deep bass and don't use a kick. Most electronica producers usually do the former, but I think I prefer the latter. (Must be my progressive-rock background coming through...)

I wanted a sequence that would capture the simplicity of a modular driven by an analog sequencer, but I didn't want to actually use an analog sequencer because (1) I didn't want the sequence to be quite that tick-tock, and (2) I don't have an analog sequencer. Having Metro drive the Juno 106 with a repeating pattern turned out to be just the thing. Funny thing about this: The sequence was one of the first things I did after putting together the drum pattern. I started it using a piano-like patch on the 106 as a placeholder, and I kept using that while I worked on other parts of the song. When the track was almost finished, I finally went back to it to create the patch I had intended, but nothing seemed to work quite as well as the piano patch, even though that patch wasn't what I had in mind and wasn't at all right for the track. I finally sort of compromised with myself by creating a patch that sort of sounds like what you'd get if you took a Wurlitzer and ran it through a wave shaper and an octave divider. This got me closer to what I wanted the sequence to sound like, without sounding too retro. The key to this patch was using gobs of the sub-oscillator, which has a different sound than the primary pulse waveform set to 50% duty cycle.

The Discombobulator plays a big part in Remove Before Flight. In the first quiet segment, there are a variety of sound effects produced using FM techniques. At the first of the year, I purchased three MOTM-310 micro VCOs from someone who was breaking up a large modular, with the specific intention of using them for FM patches. I set up a three-operator patch with one VCO modulating the second one, which modulates the third one. The first VCO is operating at a lower frequency and itself being modulated by an LFO. This patch uses triangle waves as the modulating waveforms; I've found that this often produces more interesting results than the sine waves used in the classic Yamaha FM synths. For this patch, no keyboard or other controller was used; I produced a track of about five minutes' worth of various sounds by tweaking the knobs. I recorded the audio in Metro and then chopped the track up into bits, about two minutes' worth of which actually made the final cut.

In the second quiet part, there's a series of atonal melodies. This was done using the MOTM-510 WaveWarper, which is sort of a super-duper ring modulator that takes three audio inputs and performs an analog computation on them. Two of the 310s were set to an interval (minor third, more or less) and sent to the X and W inputs of the 510. The third 310 was set to a lower frequency and modulated slightly by the low-frequency noise output of an MOTM-101. To play this, I used a keyboard interfaced via the MOTM-650 MIDI/CV interface. I configured a group of two channels and set the group to unison mode. An interesting feature of the unison mode is that if you play one note, both channels output that note. However, if you play two notes, the two channels split and each one takes one of the two notes. Each channel was fed to the control input of one of the 310 VCOs. By doing this, I could play the fixed interval that the 310s were tuned to by playing one note, or play another interval by playing two notes. Unlike the FM patch, this was not pre-recorded as an audio track; I recorded it as MIDI and played the track along with the other synths during the virtual mixdown.

The Discombobulator did one other function: That organ-like patch from the JD990 that I mentioned? It went through the Encore frequency shifter. I configured an aux output on the MOTM-650 to respond to mod wheel (MIDI CC #1) and used that control voltage to control the shift amount. The up-shift and down-shift outputs went to two channels of the mixer and were panned left and right for a stereo effect.

I did the Shepherd tones with Csound, as I have described in a previous post. I captured this as an AIFF file directly from Csound's output. This was imported into Metro and processed as described in the previous post.

The drum console is something that I'll say more about in a later post. One of my frustrations with conventional drum machines is that there is no easy way to change the pitch of the drums you select; for example, on the DR-202, you can change the pitch by going into the drum kit and changing it for that drum assignment in that kit, but it requires menu diving and is something you can't do at performance time. I've been wanting a way to play a particular drum sound over a range of pitches, to simulate e.g., roto-toms. So what I did is: I wrote a Csound program that loads a set of eight drum or percussion samples, and maps each one to a range of eight MIDI notes. Depending on the note played, it shifts the sample up or down, over a range of about half an octave. To play it, I use a Monome 40H, which has 64 keys in an 8x8 arrangement. Each row of the Monome corresponds to one sample; as you go from left to right on the row, it plays the sample at higher pitches.

Because the keys of the Monome aren't velocity sensitive, I coded the Csound program to take input from a Korg Nanocontrol to set a "velocity" parameter for each sample. Each of the 1 through 8 sliders on the Nanocontrol maps to one sample. When the slider is full up, the sample plays pretty much unaltered in dynamics. As you move the slider down, the attack time is increased; the volume is decreased, and a bit of low-pass filtering is applied. At low settings this actually produces a rather unrealistic attack sound, but I though it was interesting so I left it that way. Also, the rotary knob that goes with each channel is used by Csound to pan the sample.

I recorded the drum console parts as MIDI data from the Monome and Nanokontrol (which was tricky because I had to use the OSX IAC bus, and anytime you use the IAC bus you have to be very careful that you don't create a MIDI thru loop). So during the virtual mix I had this playing back through the Csound program. I routed the audio to its own output pair on the audio interface and to the mixer, where reverb got added. So, the resulting audio went from the digital domain to analog, and back to digital again. I learned a lot doing all this. It produces some interesting results, especially with the volume and attack manipulations. I want to extend this idea so I have a lot more control over various parameters and modifications of the samples. One other thing I learned is that the Monome isn't ideal as a drum pad controller; the buttons are kind of spongy and they have too much give for good drum pattern playing, in addition to not being velocity sensitive. But I don't know of any drum pad controller on the market that has 64 pads.

For the mixdown process, I had 12 MIDI tracks going on the various instruments, with everything being fed to the Mackie CR1604 mixer (of which I used all but one input channel, and all four of the effects returns). Nearly all of the mixing was pre-automated by setting up MIDI volume and pan commands to the various synths, so that once I had set the initial levels at the mixer, I didn't have to touch the faders during playback. There was a little bit of riding the master levels to avoid too much clipping -- I didn't use any compression. After that had been recorded to two-track in Metro, there were two additional (stereo) tracks that had to be mixed with the main two-track inside the box. One was the FM sounds from the Discombobulator, which had been chopped up from a longer track. The other was the Shepherd tones, which I wanted to keep in the digital domain, and anyway I had not set up the Shepherd program to be MIDI-controllable. That final in-the-box mix produced the track that you hear.

Remove Before Flight is Part I of the Flight Trilogy, all three of which will be electronica of some sort. I'm just starting to think about Part II. It will be called either "Sea of Crises" (a geographic feature on the Moon) or its Latin equivalent, "Mare Crisium". Right now I'm thinking it will be a downtempo piece, but I haven't decided that for sure.

Thursday, April 7, 2011

The Discombobulator at work

Here it is, hard at work on stuff for "Remove Before Flight":





Saturday, March 12, 2011

Electricity for Synth-DIY'ers: Operational Amplifiers

Now that we've covered the basic semiconductors and passive components, let's begin covering what happens when you put a bunch of them together on a slab of silicon -- the integrated circuit. One of the most basic integrated circuits, used in both analog and digital systems, is the operational amplifier, or op amp for short. Op amps are one of the most useful ICs; they can be used to amplify or attenuate a signal to any extent desired, invert a signal, and solve signal buffering and impedence-matching problems. Further, they can be used to conveniently implement active filters in the audio range, do voltage level comparisons, and a host of other analog signal processing functions.

The development of the operational amplifier actually precedes the advent of the integrated circuit. Op amps were first devised in the 1930s as a means of solving various amplification and impedence-matching problems in long line telephone circuits. At the time, they were obviously constructed using tubes since the transistor had not yet been invented; as the circuits were mass produced, they started being packaged into forms that allowed them to be treated as a single component -- some tube types were packaged such that the entire circuit could be plugged into a socket as if it were a single tube.



Philbrick Labs
K2-W tube-based operational amplifier. Photo from Wikipedia Commons.

Much research in the pre-IC days went into miniaturizing these circuits, and making them work at lower voltages. A few op amps intended for high-end audio applications are still made as "bricks" implemented with discrete transistors, but nearly all other types are made as ICs these days. (An aside: One engineer who played a significant role in the development of the early solid-state op amps was a certain young Alan R. Pearlman, who would later play a much larger role in the development of the music synthesizer.)

The first monolithic IC op amps were developed by Fairchild in the early 1960s. They introduced the first one, the µA702, in 1963; it had some unfortunate characteristics and was not a success. However, in 1965 they followed this up with the µA709, which fixed the 702's problems and went on to see widespread use; it remained in production into the 1980s. Then things picked up; National Semiconductor challenged Fairchild by introducing its LM101/201/301 series in 1967. (The series of numbers represented different ambient operating temperature ranges, with the 3xx being the commercial series and the 1xx being mil-spec; this pattern continues today for most ICs designed by National.) Fairchild said "oh, yeah?" and the next year they introduced what would become the canonical op amp for decades: the µA741. The 741 was the first internally-compensated op amp (we'll get to compensation later). Variants of the 741 are still in production today.

If you are interested in reading a very good and detailed story of the development of the op amp, see this paper published by Analog Devices.

Opamp Basics

A basic opamp has two inputs and one output. The two inputs are known as the inverting and non-inverting inputs; as one might guess, the output will be inversely proportional to the signal at the inverting input, and directly proportional to the signal at the non-inverting input. That's a bit of an over-simplification, though; it often leads beginners to believe that what the opamp does is amplify the difference between the two inputs. There's more to how an opamp works than that, though.

Here, in three short rules, is what an opamp does (or tries to do):
  1. The opamp wants the voltage at its two inputs to be equal.
  2. It assumes that a feedback path exists between the output and the inverting input.
  3. It uses this assumption to vary the output to try to make the two inputs equal.
If no feedback path exists, the opamp will drive its output to its minimum or maximum voltage, which depends on the power supply voltages and the opamp's circuit design. (Some opamps will go "to the rails" and some will stop a volt or two short.) Thus, most useful opamp circuits include a negative feedback path. Another way of putting this is that without any feedback, the opamp has extremely high gain -- almost any non-zero inputs drive it to clipping, in one direction or the other. (The theoretical ideal opamp has infinite open-loop gain. Real opamps of course cannot go to infinity, but most types have open-loop gain factors within the audio range in the tens of thousands.) The feedback path is what controls this gain. From there, it follows that how much feedback is supplied can control the opamp to provide more or less gain, and this is exactly the case.

Symbology

We'll introduce the symbology at this point. The symbol for a basic opamp is:


The two pins show on the left are the two inputs: inverting (indicated by '-') and non-inverting (indicated by '+'). The pin on the right is the output. The power and ground pins are frequently not show, but when they are, they are show sticking out of the top and bottom; any other special-purpose inputs that the op amp has will also be shown at the top or bottom. In isolation, illustrators will usually draw the opamp symbol with the non-inverting input above the inverting input. However, in a schematic, the reverse is often true; conventionally the feedback path is drawn above the opamp symbol, and since it connects to the inverting input, to reduce the number of crossing paths the inverting input frequently gets placed on top. Some schematics will use the '+' symbol to indicate the non-inverting input and the '-' symbol to indicate the inverting. But others will use the pin numbers of the specific IC, in which case you need to know what kind of opamp it is and have access to the pinout. In this article, we will keep the non-inverting input on top throughout, to reduce confusion.

The Basic Amplifier Circuits

There are two basic configurations of amplifier circuits using an opamp, the inverting configuration and the non-inverting configuration. The inverting configuration has the effect of the output being the inverse of the input; with the non-inverting configuration, the output is identical to the input except for gain. Although the inverting configuration is used more, the non-inverting configuration is easier to understand and it does have its uses, so we'll introduce it first. It looks like this:


Note the resistor connected between the output and the inverting input. This is the feedback path. Thinking back to the three rules, picture what happens when a positive voltage comes to the opamp from the external circuitry. It raises the voltage at the non-inverting input. The opamp then wants the inverting input to rise to the same voltage as the non-inverting input. In order to accomplish this, it raises the voltage level at the output.

That voltage goes over to the inverting input, where some of it is bled off to ground by the other resistor. The two resistors form a voltage divider, so the voltage at the inverting input will be some fraction of the voltage at the output. Therefore, the output voltage will have to go up higher than the voltage present at the non-inverting input before the voltages at the two inputs become equal. For instance, if the two resistors have the same value, then they form a divide-by-2 divider, and the output will have to rise to twice the voltage that is present at the non-inverting input before the circuit settles.

All of this happens very fast. The speed at which the opamp is capable of responding to its input determines its maximum response frequency, or bandwidth. Nearly every opamp on the market today has a bandwidth that extends well beyond the audio range, so in an audio application, you will rarely have to worry about it; you can assume that everything happens instantaneously. (If you get into radio, or high-speed data circuits, that assumption is no longer valid.)

The ratio of the two resistors determines the gain of this circuit. The ratio in the middle of a two-resistor voltage divider is the total resistance divided by the resistance of the "bottom" resistor; in this case R2. So the gain of the non-inverting amplifier configuration is (R1+R2)/R2, or (R1/R2)+1. In the simplest case, where R1 is replaced by a straight wire (i.e., zero resistance) and R2 is omitted (infinite resistance), the result is a unity-gain amplifier; the output will be identical to the input. What good is a unity-gain amplifier? Well, one use is for re-driving signals that can't take being loaded down, such as signals from guitar pickups. Many opamps have extremely high input impedance, and a unity gain buffer is perfect for taking signals from high-impedance sources and repeating them with lower output impedance. Note one implication of the gain formula: in the non-inverting configuration, you can't achieve a gain of less than 1.

(By the way, in practical circuits, it's not a good idea to totally omit R2. Opamps often "bleed" a very small amount of current internally back into their inputs. If this bleed current doesn't have a path to ground, it can cause the opamp to go open loop and drive the output to the rail. If the need is for a unity-gain circuit, a 1M resistor can usually be used for R2 without any practical effect on the gain ratio, and it will allow the leakage currents to bleed off.)

The inverting amplifier configuration looks like this:


How does this one work? Per the three rules, when a positive voltage comes from the external circuit, it applies a positive voltage to the inverting input. Because it is the inverting input, the opamp will respond by pushing the output negative, in an attempt to counterbalance the positive voltage and bring it back to the voltage level of the non-inverting input, which is at 0V since it's grounded. The voltage level that the output has to go to in order to accomplish this depends on the ratio of the two resistors. Since the resistors directly determine the proportion of the input signal and the feedback that get combined at the inverting input, the gain equation for the inverting configuration is simply R1/R2. Unlike the non-inverting configuration, the inverting configuration can achieve a gain of less than 1; as you can see from the formula, as R2 gets large, the gain goes towards zero. Thus the inverting configuration can be both an amplifier and an attenuator.

So when do you choose one configuration over the other? Well, for one thing, the inverting configuration obviously inverts the signal, which is useful in its own right sometimes. More importantly, though, is that you will see below that most of the more sophisticated op amp circuits require an inverting configuration -- they don't work the other way. So why not just use the inverting configuration for everything? Well, for one thing, this may result in unintended inversion of the input, which will make you have to add an extra inverting stage to get the signal right side up.

However, a more important reason is in the fact that, in the inverting configuration, the two gain-setting resistors provide a "sneak path" around the op amp between the input and the output. This can cause a problem regarding the input impedance of the circuit. The op amp itself has incredibly high input impedance, which can be a very useful property (in, e.g., a preamp for a mic or guitar). However, if the op amp is driving something else with low input impedance, the path through the resistors will lower the effective input impedance. You could fix that by using high values for both resistors, since the ratio of the resistors and not the values per se is what determines the gain. However, past a certain point (when one of the resistors gets up past about 100K), you will start to have noise and voltage offset problems.

The non-inverting configuration does not have this problem because there is no connection between the input and the feedback path. So what you often see is that, for a given device, non-inverting circuits are often used for the external inputs and outputs, and most everything in between uses inverting circuits.

Stuff You Need to Know at This Point

Now that you understand the basic principles behind the opamp, before we proceed let's go over some of the requirements and practical limits of real opamps. Most opamps require both a positive and a negative power supply, depending on the type, and these must usually be of the same magnitude in order for the opamp to work properly. In other words, if the negative supply is -15V, a positive supply of +5V won't do; you need +15V. The power supply voltages limit how far the output can swing in either direction. They also limit what input voltages are permitted; with most opamp types, the inputs must be kept at least 1-2V away from the supply voltages. If the input limits are exceeded, the opamp may go into a condition called "latchup" where it no longer responds to its inputs. Latchup generally requires that the power be removed to reset the circuit, and it may harm the IC. If there is a possibility of the inputs exceeding the opamp's specified voltage, such as an opamp connected to an external input jack, it is a good idea to protect the inputs. Usually this is done with zener diodes. There are opamps which can accept input voltages all the way to the supply voltages; check the vendor catalogs if you need one of these.

There are some opamps made to work with single supply voltages. These are sometimes useful particularly in battery-powered applications. With these, the input voltages must be kept between the power supply voltage and ground, so if you want to feed in an AC signal, you will need to add DC offset to the input and then remove it from the output.

Most modern opamps are protected against having their outputs short-circuited; if you short the output to ground, nothing bad will happen. However, there is a limit to how much current the output can supply, so if you short it to ground, the output will go to zero and stay there until you remove the short. The output current limits are printed in the specifications. If you are building a circuit to drive a very long cable -- say, an output module for a modular that needs to drive to the house mixer 75 feet away -- an opamp will a high-current output capability will be useful.

One other thing to be aware of: All op amps "leak" very small amount bias currents that occur internally on the inputs. These small currents have to have a path out via the input pins. Here's something to watch out for:


Note the capacitor on the non-inverting input; this would be typical if it was desired to block DC voltages from reaching the input. The problem is: those micro-leakages at the input are "trapped" by the capacitor; they don't have a path out of the circuit! The result is that the circuit will never reach equilibrium and the output will probably go to the minimum or maximum voltage and stay there. Here's how you fix that:


The extra resistor allows the leakage currents to bleed to ground. A 1M resistor will usually be large enough to not have any effect on the input signal.

Analog Arithmetic with Opamps

A frequent problem in synth circuits is the need to add or subtract control voltages. For instance, the control voltage fed to a VCO might need to be the sum of control voltages from the keyboard, the pitch wheel, and an LFO. Here is a circuit that will sum up any number of control voltages:



You can add any number of inputs to the input ladder at the left. To keep things simple, all of the Rx resistors should be of the same value; if you do so, the gain is Ry/Rx. Use Rx values of at least 1K to prevent the input signals from trying to back-drive each other. Note that, because this is based on the inverting-amplifier configuration, the output will be the negative of the sum of the inputs. That's easy to fix; just run it through a second inverting amplifier, with the gain configured as needed. Note that this circuit can also be used as an audio mixer; after all, a mixer is really just an adder. The one thing you might want to do if it is being used for audio mixing is add a DC-blocking capacitor (10 uF or so, non-polarized electrolytic) in series with each input.

You can subtract signals using the configuration above, preceded by an inverting amp that inverts the signal to be subtracted. However, here's a one-op-amp solution for computing the difference of two signals:



Note that this circuit is identical to what is commonly called a "difference amplifier" or "differential amplifier" (the latter is not-so-good terminology, but lots of people use it). The "balanced line" signal connection often used in recording studios consists of two signals, one of which is the negative of the other. You see this commonly in equipment such as microphones which use the 3-pin "Cannon" plugs and jacks; two of the pins carry the signals and the third is connected to the cable shield. You can use the difference amplifier circuit to convert this to a single-wire signal that you can process inside a piece of equipment. The difference amplifier produces an output which is proportional to the difference between its inputs. An interesting implication of this is that if both signals change by the same amount, the output does not change at all, because the difference between the signals didn't change. In the studio environment, this is called "common mode rejection" and is a big help in reducing noise pickup. The basic circuit should have R1 = R3 and R2 = R4; assuming so, then the gain is equal to R1/R2.

(Note that this is not the optimum version of this circuit; the main problem is that it's difficult to make the impedances of the two sides match exactly, which limits the circuit's accuracy. Here is an improved version, if you have a need for it.)

Differentiators and Integrators

Here's a pair of circuits that can be very useful particularly in a modular synth. The first is called a differentiator (not to be confused with a difference amplifier). What it does is produce an output which is proportional to the rate at which the input is changing; you can think of it as sort of a speedometer for the input signal. If the input is increasing, the output will be a positive voltage; if the input is decreasing, the output is negative, and if the input is not changing, the output is zero.



The gain of this circuit is proportional to the frequency of the signal fed into it, but is influenced by the values of R and C. The output voltage Vo = -RC(dV/dt), where R is the resistor value in ohms, C is the capacitor value in farads (not microfarads or nanofarads, but whole farads), and dV/dt is the rate at which the input voltage is rising or falling, in volts per second. (Don't worry about what the individual parts of the dV/dt stand for; just accept that it stands for "change in voltage with respect to time".) Note the minus sign, which is a result of this being an inverting-amp configuration. An easy way to think about this circuit is to assume an R of 1M and a C of 1 uF; this way the product of RC is 1, and then if the input is rising at 1V per second, the output is -1V as long as the input keeps changing.

The integrator is, mathematically, the opposite of the differentiator. To continue with the car analogy, you can think of the input as an accelerator for the output. When the input is positive, the output rises; its rate of rise is determined by the magnitude of the input. Same goes for a negative input; the output goes lower in proportion to the input. When the input is zero, the output remains where it was. Given that an input that remains positive or negative for any length of time will push the output to its power-supply-determined limit, it's useful to have a reset capability. This is shown in the schematic as a switch, but it would be a simple matter to substitute an NPN transistor or a mini relay so it could take a reset trigger signal.



Basic Active Filter Circuits

Consider the following circuit:



Note the capacitor in the feedback path. What is this capacitor doing to the feedback? Well, start by considering a very low frequency: At a low enough frequency, the capacitor is essentially an open circuit, so only the R1 resistor in parallel with it has any effect. This reduces to your basic inverting amplifier with gain determined by the formula for an inverting amplifier: R1/R2. But what happens as the frequency goes up: The capacitor starts to let some current through, in addition to what goes through R1. In effect, the capacitor is reducing the value of R1 by allowing some current to bypass it. This gets more pronounced as the frequency goes up, until the frequency is reached where the capacitor has effectively shorted out R1. At this point, R1's effective resistance is zero, and the full amount of feedback is being applied to the inverting input, which cancels out the input signal at that frequency and reduces the op amp's gain at that frequency.

This circuit is a low-pass filter. It has a certain gain at low frequencies and less gain as the frequency goes up; at a sufficiently high frequency, its gain is zero. Doing the math, we find that, just like any filter, there is a cutoff frequency determined by the capacitor's value and above that value the gain rolls off at 6 dB/octave, making it a single-pole filter. The cutoff frequency is: 1/(6.2832R1C) where R1 is in ohms and C is in whole farads.




This circuit is a high pass filter. From the above discussion, you can probably already guess how it works. At low frequencies, the capacitor is essentially open, so full feedback is applied to the inverting input, and the op amp's gain is zero. As the frequency increases, C starts to conduct and at a high enough frequency it essentially becomes a straight wire. At that frequency, the circuit's gain then is determined by R1/R2. The formula for cutoff frequency is the same as for the low pass filter. Note that this circuit, unlike the low pass filter circuit, is non-inverting with respect to the input. Inverting and non-inverting configurations exist for both low pass and high pass filters.

What if you want more than a one-pole response? Well, an obvious answer is to put several of the above circuits in series. For instance, if you use two, you get a two-pole filter with a 12 dB/octave rolloff. However, using this method for multi-pole filters means using an op amp for each stage, which can make for an expensive circuit. So, electrical engineers have devised all kinds of devious circuits for implementing multi-pole filters that do not need an op amp for each pole. For instance, the Sallen-Key circuit often used in synth filters implements a two-pole low pass or high pass filter with only one op amp.

Sallen-Key filter, from Wikipedia Commons

Op Amp Filter Topologies and Response Types

Here is something that people often get confused about when they read about op amp-based filter circuits. The topology is the logical arrangement of the components in the circuit. There are a bunch of ways of designing filter circuits, particularly multi-pole filter circuits. The Sallen-Key is one such topology; others often found in synths are the biquad and the multiple feedback. The response class refers to the general shape of the response curve. The three types you will hear most often in audio systems are Butterworth, Chebyshev, and Bessel; most synth filters belong to the Butterworth class. The differences between them are in exactly what the frequency response curve looks like; for instance, the Butterworth type is very flat in the passband, while the Chebyshev has some variations ("ripple"). All three of these filter types can be implemented in various topologies, and usually the difference is in the ratios between certain components. There is some pretty complicated math behind these, but you don't have to do the math; there are all kinds of design tools that allow you to plug in the desired characteristics and it will calculate the component values for you. Here is a simple one which will calculate a Sallen-Key (12 dB/octave) low-pass filter of the Butterworth class; all you have to put in is the desired cutoff frequency and one capacitor value. I'll do a future post which explains some of these active-filter types in more detail.

Compensation and Offset Nulling

All op amps require what is called compensation, in order to keep the op amp from going into self-oscillation under certain circuit conditions. The compensation consists of one or more capacitors that are placed into the op amp's internal circuitry. The first op amps were externally compensated -- they required the designer to add capacitors to compensation terminals on the device. However, most op amps today are internally compensated; the compensating capacitors are built into the op amp itself. In terms of ultimate performance, internally compensated op amps are a compromise; using external compensation allows the designer to extend the op amp's bandwidth and/or reduce its power draw, depending on the need. However, in designing synth circuits, these are seldom important factors. Therefore, there is usually no reason not to use internally compensated op amps in synth circuits.

The ideal op amp should, if both of its inputs are grounded, drive its output to exactly 0V. Real op amps will usually have an offset ranging from microvolts to a few millivolts, depending on how the inputs are configured. This is caused by small current leakages in or out of the input pins. Some op amps have inputs to which you can connect a trimmer pot that you can adjust to null out the offset. This can be important in, for instance, a control voltage input to a VCO. If you need this, look for an op amp type that has "balance" or "offset null" inputs.

Op Amp Types and Specifications

These days, nearly all op amps are packaged in the familiar dual-in-line plastic package, in either through-hole or surface mount configuration. (A very few of the oldest types are still available in the metal can that looks like an oversize transistor with more legs.) A single part often contains more than one actual op amp; dual, triple, and quad packages are common. Single types nearly always have 8 pins while types containing more than one per package may have up to 16 pins.

Things that you (maybe) need to be concerned about when you are searching for an op amp for a synth application are:
  • Number of individual op amps in the package
  • Minimum and maximum power supply voltages
  • Input impedances
  • The gain-bandwidth product
  • Whether the op amp can run off of a single supply voltage
  • The voltage range of the output
  • Output drive capacity
We had a lot of fun back in the history writeup at the beginning of this article talking about the 741. However: Unless you are replacing a part in a vintage synth, don't even think about using one today. There are much better types available now. A popular general-purpose type is the TL08x series, originally designed by Texas Instruments but available now from multiple sources. These are available in various packaging containing 1, 2, or 4 individual op amps per unit. The inputs are JFET circuits and have very high input impedance. They can be powered at ±12V or 15V (the voltages used in modern modulars), and the permissible input voltages range to within 2V of the supply voltages. Another useful general-purpose type is the LM358, also available from multiple sources. It has most of the same virtues as the TL081 (single op amp per device); the input impedances aren't quite as high, but still adequate for most synth circuits. And they are inexpensive enough that you can buy a tube of 50 or so, to keep on hand for circuit prototyping or other off-the-cuff uses. Here is a table containing some potentially useful types that I extracted from the Mouser catalog. (The file is a .CSV file, which you can download and import into any spreadsheet application.)

Monday, January 17, 2011

More Shepherd Tones from Youtube

These are not mine... they are things I found while doing various searches for Shepherd tone examples.

First example:



I think the author is using this Reaktor ensemble, from the Native Instruments user-contributed library. It starts out using tones at octave intervals, and I think the cycling is rather obvious. It becomes more convincing when he sets it to narower intervals, starting about 0:55 in.

Second example. This one uses discrete quantized intervals rather than a continuous glissando:



As you can see, the author added a note indicating that he doesn't think it turned out very well. However, I actually find it more convincing than the first example. This is despite the fact that, according to the author, it only uses two tones at a time. I think this may have to do with the chime-like tonality of the tones used; there's a lot of upper overtones and it sounds like some of the overtones are enharmonic. The addition of the drum machine track, while not necessary for demonstrating the principle, adds a nice touch and illustrates a possible use in a musical context. Unfortunately there is nothing in the author's notes about what hardware or software he used to make this.

Third example. I was utterly floored by this one:



Now obviously there's a lot more going on here than just sweeping tones up and down. The author mentions that it uses FM; I don't know if it's using the FM to do some of the tone sweeps and spreading, or just for tonality variations. He apparently did this with a Reaktor ensemble that he built himself. Note the stereo effects. In some places the illusion is very convincing; in other places cycling is somewhat obvious. It seems to hit a place at about 5:10 where the sweep can't go any further, and then at 5:58 it starts back in the other direction. Frequency shifting? The author's notes don't say.

(After you finish listening to this one, go to the author's Youtube page and check out his favorites -- rather interesting list.)