Envelope Circuits: a simple AR design using op amps

A very simple Attack-Release envelope generator can be built with a dual op amp and just a handful of extra components. The input stage is basically the same as my op amp gate buffer, with only its output resistor changed; the rest is a simple low-pass resistor/capacitor setup with an output buffer. Here’s how it works:

The input acts as a comparator. When the gate input goes high, the comparator output goes high, and the capacitor is charged up via D2 and the Attack pot RV1; when the gate goes low, the comparator goes low, and the capacitor discharges through the Release pot RV2 and D3. The diodes directionalise this process, so the attack time is governed only by the Attack control, etc. The output is a very simple unity-gain follower.

 

Operational Amplifier Attack-Release Envelope

Operational Amplifier Attack-Release Envelope Schematic

 

With the values shown, attack and release times range from just a couple of milliseconds to around 5 seconds. Larger values for the pots and/or cap will extend the times proportionally, smaller ones reduce them. The 560 Ohm resistor sets the minimum time against a given capacitance.

With an op amp such as the LM358, the output will swing between 0V and approximately 1.5V below the positive rail. If a lower output level is desired, add a potential divider of resistors in the low-mid single Ks after the output buffer amplifier, taking the overall output from their junction.

Supply voltage is not critical, but as mentioned above, the LM358 op amp will swing to around 1.5V below supply at maximum. It does, however, swing to ground too, which when operated on a single supply is necessary in obtaining a correct ‘gate low’ output. If you cannot find a 358, use another op amp which will swing rail to rail, or ground to near-positive.

*

A circuit like this makes a nice addition to synths with only one envelope, such as the Moog Werkstatt and Mother 32, or Arturia Microbrute. It will run from a 9V battery and is small enough to build into the Werkstatt itself, or indeed any small external box of your choice. You could easily build one for a Eurorack modular system too, and it will run happily on +12V or +15V.

For details of how to modify the Werkstatt, take a look at my Werkstatt page.

*

Op Amp AR, parts list:

U1: LM358 or similar
D1-3: 1N4148 or equivalent
C1: 1µ poly non-polarized
R1,2: 100k 1/4W resistor (I use 1% Metal Film types, but 5% Carbon are also fine)
R3: 82k —”—
R4: 18k —”—
R5: 560Ω —”—
R6: 1k —”—
RV1,2: 1M linear pot
Input and output connectors as desired.

Advertisements

Tags: , , , , , , , , , , , , , ,

10 responses to “Envelope Circuits: a simple AR design using op amps”

  1. Ewan Mathers says :

    Hi there, I have used your proper gate input on my Werkstatt and it works perfectly! If I build the “Envelope Circuits: a simple AR design using op amps” how do I implement it in the Werkstatt? Do I just connect this circuit in series with the “Gate In”? If so what exactly does the AR then control? Help with implementing this would be appreciated! Thanks, Ewan

    • synthnerd says :

      Hi Ewan. The AR is intended to be flexible, so there are different ways you could connect it. Its input should be driven by your chosen gate source; one way of doing this would be to simply connect the input of the AR to the tip connection of your DIY Gate Input jack socket. You could route the AR output to anything you like that takes a CV control: VCA, VCF, pitch, LFO speed… that’s your choice. If I were building this into the Werkstatt body itself, I’d simply route the AR output to a jack socket, and then plug it into whatever I wanted.

      Another option would be to tie the AR gate input to the Gate Output on the Werkstatt’s header. I’d take the power from the 9V line if you’re building this internally.

      Bear in mind that the output of this simple circuit is not attenuated, so you would benefit from running it into a potentiometer to act as a modulation level control.

  2. Roberto Corti says :

    Hello! I’m using this env gen amp op for a project. It’s not completely a synthesizer. I’m generating tones with an Arduino and I want to modificate the square wave with this circuit. But I’m simulating and I’m getting a direct signal , a line. How can I fix this? Greetings

    • synthnerd says :

      Hi. OK, if I understand you correctly, are you trying to change a square wave into a sloping wave? One way is indeed to slew the up and down edges. Some of the old stringers do this, for example. However, this circuit is intended for relatively slow inputs (a Gate input is much slower than an audio signal) so if you’re using this circuit just as it is shown here, you won’t get anything out of it from an audio rate input. The component that governs the overall ballpark response time is the capacitor. Try something much smaller. The exact value to try will depend on the speed of your square wave. The other problem is that audio signals range from 20Hz to 20kHz (although you won’t be using all that range for notes), and this circuit gives a fixed-time response, not something that varies along with the speed of the input. Those old stringers that use a simple slew limiter to shape squares into sawtooths, they had one circuit for each key and the parts were chosen to suit each one. If you want a circuit that will make a predictable ramped wave from a square of any frequency, you need a different circuit really.

      Hope that helps.

  3. Roberto Corti says :

    It helps a lot! Thank for the response. I have used the circuit, it already works. I’m getting a triangular wave at the output, when I put a square wave at the input. It´s not the correct application, but it works.

    Thanks for the response again

    Greetings 😀

  4. Roberto Corti says :

    Another cuestion. What exactly is the gate? It´s a small signal? It´s a current ? A voltage? A switch?
    Greetings 😀

    • synthnerd says :

      Gate signals can vary between systems, but typically something like 0V for ‘off’ and 5 to 10V for ‘on’. Inputs are usually tolerant of a wide range. Some systems use “S-Trig” which shorts the connection to ground for ‘on’, and these two methods are not directly compatible.

      • Roberto Corti says :

        Thanks a lot for answer… Sorry for making a lot of questions. 😀
        I have a piano project made with an Arduino which generates square waves at the tones frequency. I have to module this square waves with this ar envelope generator to get an amplitude modulated square wave.
        I have two questions:

        – Can I generate the gate with a monostable 555, actioned by the switches of the Arduino?
        – Is there any circuit which helps me modultes these two waves (the square wave and the envelope)?

        Thanks for your time!! 😀 Hope you can answer soon 😀

  5. synthnerd says :

    The very short answers to your two questions are: 1) yes, 2) I don’t know what you mean 🙂

    The longer answer(s)…: What signal does your Arduino output? How many gate signals can your Arduino generate at once? Do you need to multiplex these outputs? There are different ways in which you could amplitude modulate a square wave, and different ways in which you might want to trigger the envelope. So really all this depends on the exact implementation you’re looking at. All this is too complex to go into here. As for modulating the envelope, I don’t really know what you mean – if you mean control over the attack and release times, yes, but it gets much more complicated…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: