Wednesday, 12 February 2020

Synthesizer Extra's No. 01: SIMPLE AD/AR using the 7555

A fantastic little AD/AR envelope generator that is super easy to build and works very well.  Perfect little adition to the DIY synthesizer.

I was looking for a better AD/AR design than the one I had built and used upto now and I came across the Thomas Henry design. Here is the schematic.
This design uses the CMOS version of the NE555, the 7555 and it can be built on a piece of stripboard that is the same size as the LMNC version that I first used.

If you're new to all this; AD/AR stands for Attack Decay/Attack Release. It's a little Envelope Generator creating a control voltage that can open and close a Voltage Controlled Amplifier (or you can drive a filter with it. There are lots of options.)
In the picture below is the stripboard layout I made for it. I added all the features that Sam Battle has in his design, like the Arcade push-button with internal light and I added a little thing of my own, an option to double the output voltage of the Envelope from 0 to +5V to 0 to +10Vpp. I always find it handy to have a bit of extra charge on the envelope if I want to use it to control a filter for instance. You can of course connect a potmeter to the +10V output and so turn the output amplitude up or down from 0 to 10V. That way you can do away with the +5V output altogether. Since I already made and wired up the panel for this, I couldn't use the potmeter option. I simply exchanged the old stripboard for this new one and soldered all the wires back in place. You can also wire up the opamp in such a way that it inverts the envelope. That would be easy enough to do. As a final extra I put in buffer stages for the envelope output, for both the +5V and the +10V output. You could also wire one of those up to be an inverter. Lots of options here. One thing that is different from the LMNC version is that the Arcade Push Button won't work as long as a key is pressed down. The Gate signal has priority in this design.


(All potmeters viewed from the front.)
(Last revised: 1-March-2020: Changed attack and release pots from linear to logarithmic.)

Here's a close-up of just the print:


Bill of Materials:



A little word on operating this from a dual 12V power supply. It will work but you'll need to change one resistor at the output. (R7 on the schematic). The 2K2 (R7) becomes a 3K3. This is necessary to give pin 6 on the 7555 the correct threshold voltage. I myself put in a 5K trimpot for R7 so I could experiment with the threshold voltage. It turned out that changing the resistance value of R7 mainly influenced the amplitude of the Envelope. In other words, you can set the initial envelope voltage with it. So after I learned this I took the trimmer potmeter back out and put in a 3K3 resistor.
Because the resistors at the output influence how this AD/AR works I decided to add some extra buffer stages at the end, for the envelope output. I noticed that impedance differences, when connecting it to certain filters in my synth, can make the AD/AR hang sometimes. The release won't activate like it should, probably because the threshold voltage on pin 6 is disturbed somehow. I didn't want to rebuild the whole print so I made a little print with just a single TL072 on it and buffered the +5V aswell as the +10V outputs. I stuck it onto the main print with hot-glue. It now works perfectly. No hanging or anything. I incorporated the buffers on the stripboard layout and I'll leave it up to you whether you want to include it or not but I highly recommend that you do.
This design works a lot better for me than the LMNC one. This AD/AR reacts to trigger signals with an amplitude of +4 V and upwards and gate signals from +1.8 V and upwards with a maximum frequency of at least 60Hz. For triggering to work well, you need to open up the Attack a tiny little bit. Otherwise the envelope pulse shuts off before it has time to reach full potential. I tried different things to fix this little issue but I wasn't successful upto now. Anyway, it's nothing serious having to turn up the Attack a tiny little bit when using Triggering. I do strongly advise you use a logarithmic potmeter for the 1 M Attack potmeter. I used a normal linear one first but had trouble setting short attack times accurately. I've now put in a logarithmic one and it makes a world of difference. Works so much better. I haven't changed the potmeter for Release because it's not that important to me how accurate Release works and it's a bit awkward getting to it beneath all those wires, but for Attack it's a must. Of course if you're building one yourself then just put in two logarithmic 1Meg pots. For the 4,7µF capacitor you can use a normal electrolythic capacitor. You don't need to use a Bi-polar capacitor in this circuit, unlike the LMNC one. You can put in extra electrolythic capacitors in parallel with the 4,7µF cap. to stretch the Attack time to the maximum length you want. I put in a 3,3µF and two 1µF caps for a total of 5,3µF which gives me almost 10 seconds maximum attack time. If you need long Attack times just put in a 10­­µ­F cap.

The AD/AR works as follows: In AR or Gate mode, the Attack remains high for as long as you keep the key on the keyboard pressed down. After you let go the Release kicks in and the signal will fade out in the time you have set with the Release potmeter.
In AD or Trigger mode the Attack/Decay cycle still needs to have been completed before you can trigger it again but as soon as the Attack cycle has been completed the Decay kicks in, regardless of whether the key is still pressed down or not. For fast trigger sequences the Attack and Decay need to be set to short times because it won't trigger again until the cycle is completed, and that's perfectly normal.
So with the Attack a tiny bit open and Decay/Release fully closed you get a powerful envelope pulse of either 5V or 10V depending on how the switch is set.
In Gate mode you can have both Attack and Release fully closed to get fast short envelope pulses as the video below will demonstrate.
If you build this circuit with separate inputs for Trigger and Gate, and you feed it both at once, the Gate signal will take preference.
Here are some technical specifications:
Minimum Attack time: 692 µSec
Minimum Decay time: 248 µSec
Maximum Attack time: 6 seconds with 4,7µF cap.  9 seconds with 5,3µF (which is what I installed)
Maximum Decay/Release time: ±30 sec.
Maximum input pulse frequency: ±60Hz

Here's a link to the Electro-Music Forum page that deals with this design:
http://electro-music.com/forum/topic-61297.html

Here's a little demo video of this AD/AR in action:




This second video shows one way of using the AD setting (trigger mode) of the AD/AR to control the cutt-off frequency of the ARP2600 filter. The Attack is fully closed so the instant a key is pressed the envelope voltage opens up the filter and then the Decay sets in and slowly closes the filter off as the envelope voltage fades down to zero. Watch the big blue light and listen to the effect on the sound.



The LED inside the Arcade push-button is connected to the +10V envelope output with a 4K7 resistor. It shines nice and bright. There's also a yellow LED on the panel between the input and the output. That one is connected to the output jack with a 1K resistor. It shines normally when you use +5 V out and extra bright when you use the +10 V output level. This is just a handy indication of how the output switch is set. It also reacts faster to pulses than the LED inside the push-button so it's a better indicator for that too. The LED was already built in so I thought I might aswel use it like this. :)
The Arcade push-button switch, which is the manual trigger, is fed with half the positive rail voltage (+7,5V) by means of the voltage devider formed by the two 68K resistors. I thought that was better than giving it the full whack of the +15V rail voltage. You can of course use other values for these as long as they are both the same. If you want to feed the switch with a different voltage then you can calculate that voltage as follows: Say R1 is the resistor coming from +15 V and R2 is the resistor going to ground. V = 15/(R1+R2)*R2
The arcade push button will not work as long as a Gate signal is present!!
Gate takes priority over manual trigger, just so you know that.

Okay, conclusion time: This design is a big improvement over the LMNC simple AD/AR and I can highly recommend using it. It works very well with patches where you feed it a fast trigger signal to control drum modules for instance. The switch which lets you choose between +5V or +10V output works perfectly fine but if you want more control just build it with the output controlled by a potmeter like I mentioned before. I do recommend you include the extra buffers at the end. They will insure that this AD/AR works perfectly under any condition. The only tiny little down point is that in Trigger mode the Attack needs to be a tiny bit opened to get a full envelope pulse. With Attack fully closed in Trigger mode, the pulse you get on the envelope output stops so fast that is doesn't have time to reach the full voltage potential. You could say it's too fast for its own good. You can see this happening on the oscilloscope. You get really fast pulses that don't reach the full voltage before they're cut off again. In Gate mode you won't have this issue and it works just perfectly. I really like this design and I highly recommend building it.

Here's a picture of how I added the buffer stages by glueing on a little print with a single TL072. This saved me from having to rebuild the whole thing.



Finally, for my own record keeping purposes, here's two pictures of how the finished synthesizer now looks, with two new VCO's and the Envelope Follower and the little oscilloscope of course:




Okay that's it for this article.
This article isn't really part of the synthesizer build itself so I named it 'Synthesizer Extra's'.  That's the header I will use for articles describing enhancements and changes to the original synthesizer that I build in the past 19 articles.
If you have any questions please leave them in the comments and I will answer them asap. Leave me a comment anyway, while you're here. That would be cool. Okay, see you on the next one.

Friday, 7 February 2020

Synthesizer Build part-20: ARP2600 ENVELOPE FOLLOWER with pre-amp.

An external input module copied from the famous ARP2600 synth, which produces a Control Voltage, Gate and Trigger from an audio signal.

Although I pretty much finished the first stage of my synthesizer build, I got inspired to try and add one more module to the case after watching this documentary about the ARP2600. I always wanted some sort of external input module in my synthesizer and in this documentary they talk about the opening of a famous song by The Who called 'Who Are You'. Pete Townshend plugged his guitar into the ARP's Pre-amplifier and through the Envelope Follower to get the effect you can hear in that song. So I started to look into Envelope Followers and asked on Facebook for schematics. It turns out these schematics are all variations on the same theme and look and perform very much the same. That's easy to understand as they all need to perform the same task.
Now what is an Envelope Follower I hear you ask and to be honest, I didn't know myself until a week before starting this build. An Envelope Follower (or EF) creates a Control Voltage who's amplitude follows the amplitude of the input signal. So the voltage sort of follows the contours of the input signal. This is nicely illustrated by the oscilloscope pictures below. And as an extra it also produces Gate and Trigger signals if the input volume passes over a certain threshold, so this can also be used as a Gate Extractor of some sort.  So in other words, you can input external signals and get control voltages, gates and triggers from them. Just what I wanted.
I did some research and it turns out that Alan R. Pearlman (founder of ARP Instruments Inc.) won a prize for designing a tube based Envelope Follower in 1948 and he wrote a thesis about it for his senior year at Worcester Polytechnic. I dug around and found the ARP2600 service manual in which I found the schematic for the Envelope Follower with pre amplifier. The chip they use for the preamp is the 1339-01 which is long obsolete I believe (I couldn't find it) so I decided to make the pre-amp with the venerable LM386.
Here's how this circuit works (quoted from the ARP service manual):
A1, CR2, CR1 and A2 comprise a full wave rectifier for the audio signal. The positive portion of the wave, on pin 6 of A1, goes through CR2 and into the non-inverting input of A2 (pin 3). The negative portion of the wave passes through CR1 into the inverting input of A2 (pin 2) so that the output of A2 is always positive. The rectified signal is then filtered by R12-15 and C7-10 and then amplified and buffered by A3.

Here is the original schematic from the ARP2600. (The microphone pre-amplifier it uses is the standard datasheet circuit for the 1339-01 chip):


As you can see it doesn't have a 'Gate out' or a 'Trigger out' so I took that function from the PAiA schematic and I came up with this as the schematic which I used for my build. The component numbering follows the numbering on the original ARP schematic, as far as possible:



(Last revised: 17-Feb.-2020. New drawing. Added smoothness switch + 8V wiring.)

In the schematic I drew above, I put in all the different points at which we can input signals of a different level or amplitude. The most sensitive input is the electret microphone input. The next input is the one at switch S1 which bypasses the transistor microphone pre-amp and inputs straight into the LM386. This can be used for a guitar for instance. And the last input, which can take voltages of a Control Voltage level, upto +10Vpp, bypasses the whole pre-amplifier circuit altogether. It can be used to input a signal straight from a HiFi audio amplifier's speaker output for instance. Because the input of the E.F. needs such high signal levels, the circuit includes the LM386 amplifier to provide those high levels.
Switch S2 let's you choose to input a signal from the on-board amplifier or from an external amplifier into the Envelope Follower. I've incorporated all the inputs in the layout below. I don't like trusting the switches built into the jack sockets so I always install separate switches instead but you can use jacks with built in switches of course. I've also added a LED to the Gate output to get a visual indication of the working of this circuit which is very useful to have, especially to see if the input is clipping.

So one more time for clarity: The 3 inputs all need different input levels. From a few millivolts for the electret microphone input to about 1Vpp for the LM386 input to upto +10Vpp for the direct Envelope Follower input. So for instance, connecting a microphone to the E.F. input isn't going to work because the level will be too low.

The one thing this design has and which the other schematics seem to have left out, is the extra 24dB/Octave low pass filter between opamps 2 and 3. I copied this straight from the original ARP schematic and it works very well. The filter's cut-off frequency is 53Hz. The signal is attenuated quite a bit by this filter but is then boosted again by the almost 10x gain of opamp 3 with the 10Meg feedback resistor.
The pre-amplifier is very effective. It puts out quite a loud signal and has it's own output jack in the layout so you can lead the signal into a filter or mix it with the VCO sounds and then have the filter controlled by the output of the Envelope Follower. (The pre-amp is fed by +8 Volt so the maximum amplitude of the signal is also +8 Volt.) Leading the envelope into a VCO doesn't sound very good, at least not when the envelope is produced from human voice. It's better to use it for a VCA controlling volume. After considerable testing I added one feature. An Envelope smoothener. It's just a 47µF cap over the output jack which can be switched on and off. It is effectively forming a lowpass filter with a cut-off frequency of 3.4Hz, filtering out the erratic higher frequency spikes and pulses. More about this at the bottom of this article.

Here is the stripboard layout that I made and used for my build. The components are quite spread-out but I had to keep the overview to be able to troubleshoot it, should that be necessary. You could easily make a more compact layout yourself, but this is what I used and this is how I wired it up. The only things not on the layout are the extra two 6½ mm (or ¼ inch) input jacks you can see in the pictures below but they just go parallel over the 3½mm Pre-Amp and E.F. input jacks. The ones connected to the switches. All potmeters viewed from the front. Layout is verified.



(Last revised: 10-March-2020.  Corrected a missing cut in copper strip at output LM386.)

Close-up of just the print:


Bill of Materials (the numbering of components is different from the schematic but the amounts and values are all okay.) :



And finally some test results in the form of screenshots from my oscilloscope. (I only had 3 channels available on my scope 'coz I blew up channel 1, aaargh! :p  )
In this first picture the purple line is the trigger output which is 10 Volt, the light blue is the envelope and the dark blue is the output from the pre-amp. The trigger pulse takes about 100 mSec to die out completely but if you want that time to be shorter just put in a smaller capacitor for C12, the 3n3 that is at the Gate to Trigger junction in the schematic drawing. The Gate and Trigger outputs are about 10Vpp. If you want that value to be lower you can exchange R24 for a 50K trimmer. R24 and R25 form a resistor voltage devider that determins the output voltage of the Gate pulses. So by making R24 higher in resistance you bring down the Gate voltage.


In these 4 pictures below, the purple line represents the Gate output:






The different level controls work very well and I can get Gate, Trigger and useful Envelope voltages from this circuit while wispering in the microphone or, giving it more attenuation, I could be shouting in the microphone, makes no difference. The LED will indicate when it clips by being on continuously so you simply attenuate more and that's it. With all these different inputs and level controls this circuit can take an enormous range of input signal voltages.
One thing to remember, the Gate and Trigger signals need to go into high impedance inputs like opamps (and that's usually the case anyway, so no problem). If you pull any current from them their voltages will drop.
The pre-amp works very well with this Envelope Follower. It's a good combination. Btw, this preamp design is the same as the one I used for the 100 LED oscilloscope project, only that one didn't have adjustable gain.

Some pictures of the stripboard at its testing stage:




Here's a look at the finished module:



Here it is built into the synth in the only place I had left:




I have three inputs, one for electret microphone, (3,5mm jack only). One for input preamp, bypassing the transistor (3,5mm and 6,5mm jack). And an input bypassing the pre-amp altogether (again with a 3,5mm and a 6,5mm jack). The 6,5mm or quarter inch jacks are for instrument inputs like a guitar.
There are four outputs which are all 3,5mm jacks. Gate, Trigger, Envelope and pre-amp audio out, with a LED to indicate Gate activity.

EXTRA ADDITION/Lag control:
Okay, as I write this it is 9 days since I first published this article and I have done some more experimenting and I thought the envelope looked a bit rough sometimes, especially with speech input so I did some experiments to see if I could smoothen it out a bit. I put a 47µF capacitor over the Envelope Output with a tiny little switch so I can turn it on or off.  Together with the 1K output resistor this forms a simple lowpass filter which works very effectively. The cut-off frequency of this filter is 3.4 Hz so it suppresses all fast voltage fluctuations. You can easily adapt this filter to your own needs. Click here to find a handy calculator for finding the right capacitance for a given frequency. This filter doesn't affect the Gate and Trigger generating circuit because that is fed straight from the output of the opamp before the signal goes into the filter.
I have incorporated this smoothness control in the schematic drawing and also in the stripboard layout. This is in fact the same approach as the ARP2600's 'Lag' control. The ARP has a Lag control which you can switch in series with the Envelope output. This Lag control is nothing more then a 100nF cap and a 1Meg potmeter forming a lowpass filter that gives a phase shift of 90°. Some people also call it a Slew Rate Liniter because it delays the time that sudden voltage changes can take place. In other words it would turn a squarewave into a Sharkfin-wave. I only found this out after studying the ARP2600 service manual and finding the schematic for the Lag control on page 29. 
I couldn't incorporate the full Lag control. Indeed I had almost no room left on the panel to add even a single switch so I moved the Gate-LED up and used that hole for a micro on/off switch that pushes in or out. I glued it in place with hot-glue. This works fantastically. Here are some of the test results from the oscilloscope. The lightblue waveform on the left is the envelope without smoothning and then I push the switch on half way in and you can see the wave smooths out to the right. Dark blue is the audio waveform. You can see in the bottom scope picture that the lowpass filter introduces a small lag of about 25 milliseconds which corresponds to about a 90° phase shift around 3Hz.






Here's a picture of the panel with the new switch. It's the little white square underneath the LED, I labeled it LPF 3Hz (Low Pass Filter 3Hz).




Okay, that's an other one done!
I must say I am extra proud of this build because it is the first project that I designed myself and where I didn't use pre-made plans from other people. Of course I didn't design the circuit but I did convert it from 1970's components to 2020's components and made the layout. And the fact that it worked so well right from the first testing stage makes it a very satisfying project for me to look back on.
Anyway, I hope you enjoyed this article and if you have any questions please put them in the comments below. You can follow this blog to keep up to date with the latest posts.
See you on the next one!