Apr 9, 2016

Slope generator

The design of this module started of as a simple AD/AR envelope generator, but in the end it became a module strongly influenced by the classic Serge voltage controlled slope module, which is a voltage controlled slew limiter, as well as by a modern implementation, the Makenoise Maths. Anyway, this module is a voltage controlled slew limiter, ADSR envelope generator and LFO. The heart (the voltage control method) comes directly from the Serge design, but the surrounding logic circuitry is different.

Slope module with wooden front panel

What it does

This is a very versatile module. The central component in a slew limiter. Here is an example where a stepped voltage from a sequencer (not shown) was fed to the input, and at the output slowly glides from one level to the next:

Example use as slew limiter

A common usage for this effect is to create glide or glissando on pitch CV. The slew limiter has separate controls for the rise time (slower in this example) and the fall time (faster in this example), and both can be controlled with CV.

The unit also has a gate input, which can be used to generate ADSR style envelopes:

ADSR envelope

When used as an envelope, the rise control sets the attack time, and the fall control sets both the decay and the release time, and there is sustain control that sets the sustain height. There are separate shape controls for both rise and fall, which can be used to create exponential shapes in two different ways:

"Exponential growth"
"Exponential decay"

Finally, there is a loop switch, which turns the module into a kind of LFO. It can generate various waveforms, ranging from very slow (10s of seconds) to audio rate.

Looping mode with linear ramps

Looping with different shape settings

In addition to the main intended modes (slew limiter, envelope and LFO), one can try to use the functions simultaneously, which usually produces some glitchy quirks.

How it works

Let me first introduce a basic slew limiter, with the following schematic:

Basic slew limiter

The slew limiter consists of two parts, an integrator and a comparator, which are combined in a feedback loop.

The integrator consists of U1C and C1. Any current that comes in through R3, has to go through C1, because the opamp input does not take any current. But to make current go through C1, the voltage across it has to continuously decrease. Similarly, when a negative current goes through R3, the output has to increase. The output of U1C is the inverted sum of all current that has ever gone through R3.

The comparator is U1B. It compares the + input with ground (the voltage at the - input). The + voltage is influenced by R2 and R1: it is the average of the In and the Out voltage (we use R1 = R2). If  In + Out > 0, that is, In is larger than -Out, the comparator output goes to +12V. This makes a positive current go through R3, which makes Out decrease until -Out = In. Then the circuit stabilizes.

In short, the whole circuit is an inverter, but the output only changes slowly due to the integrator. The time constant of the slew limiter is set by R3*C1, and can be changed by making R3 a variable resistor.

Adding voltage control

To make a voltage controlled slew limiter, we need some way to make a voltage controlled variable resistance in place of R3. There are several ways of doing this, but a very nice solution was introduced by Serge Tcherepnin back in the 70. The idea is to use long-tailed pairs (LTP), which I already talked about in the VCA article. A very helpful explanation of this circuit can be found on Tim Stinchcombes site.

When the output of U1B is negative (the module Out is rising), the pair Q3+Q4 is active. Resistor R3 sets the total current (and thus the maximum slew rate). This current can be drawn either through Q4, in which case it goes to the integrator, or through Q3, which simply connects to ground. How the current is distributed between Q3 and Q4 is determined by the differential voltage (Rise2 - Rise1), which give two points for voltage control.

Similarly, when the output of U1B is positive, and Out is falling, the pair Q1+Q2 is active, giving voltage control over the falling slew rate.

Finally, because the slew limiter inverts the signal, an extra inverting amplifier U1A has been put at the input. The total circuit now has a gain of 1.

Loop stability (update March 2019)

The basic slew limiter circuits shown above has stability issues at some settings, causing the output voltage of U1B to oscillate. While these oscillations are quite small at the final output, it is a good idea to fix them.

The slew limiter can be stabilized with a small resistance in series with the timing capacitor C1. This is shown as resistor R7 in the complete circuit below. The value of R7 can be adjusted if needed, in my tests 470 Ohm seemed to work well. Note that the output is tapped off between C1 and R7, such that the voltage drop over R7 does not affect the slew limiter output.

Complete circuit

Below is the complete circuit of the module. In addition to the slew limiter part, there is gate processing and logic for the envelope mode, the loop function, and finally processing of the voltage control sigals.


The gate input is processed by a Schmitt trigger, Q5 + Q6 and surrounding components, which turns any input signal (at least ~ 1V) into a well-defined gate. This gate is turned into a short trigger pulse by C3/R17. 

The envelope timing is controlled by U1D, which acts as a set/reset latch. The latch is "set" by the trigger pulse. This makes the output of U1D go negative, and this negative voltage is fed to the slew limiter, which then starts to ramp up the main output. Feedback resistor R11 keeps the latch "set" even when the trigger has ended. The slew output continues to rise, but when it reaches about 5V it "resets" the latch via R10 and D1. The slew limiter is now free to go downwards again, completing the Attack/Release envelope circuit. The Sustain function is created by feeding part of the gate signal to the slew input through R8.

Loop function

The loop function is very simple: it switches in a positive feedback path R5 around U1B. This makes that the slew limiter wants to continue in the direction it is going. It continues until the output reaches about +5V or -5V, and the negative feedback via R1 becomes stronger than the positive feedback through R5. Then it flips around, and loops eternally in the +/-5V range.

Control voltage processing

U2 forms four attenuverter circuits, that can attenuate as well as invert a CV signal with a single knob. U1A and U1C are for the rise and fall CV inputs, respectively, and these are scaled down and fed to the Rise2 and Fall2 points in the slew limiter. U1B and U1D are for the shape controls. These work by feeding a portion of the output back to the voltage control points Rise1 and Fall1, either directly or inverted. This creates, depending on the setting of the shape potentiometer, either exponentially growing or exponentially decaying outputs. Exponential decay is like the RC charging/discharging curve found in many traditional ADSRs (including mine), while exponential growth gives signals that start off slowly, but then end with a fast spike. The manual settings for rise and fall time are also combined to the Rise1 and Fall1 points.

Other details and modification ideas

  • The frequency range can be adjusted by changing R3 and/or C1. Bigger values give slower response.
  • The output of U1B could be used as a basis for logic signals that indicate when the output is rising (U1B at -12V), falling (U1B at +12V) or in steady state (U1B at about 0V). Especially the falling option is easy to implement and useful: the module can then be a pulse delay and shaper, where rise time sets the delay and fall time sets the pulse length.
  • It would be useful to add an LED to indicate what the output is doing. A bicolor LED (two LEDs in one package) is most suitable, for example with an opamp driver circuit as shown in this LFO, or simply with a series resistor (value 2.2k - 10k depending on desired brightness) directly from Raw out to ground.

Built module on a prototyping PCB