Tag Archive | Gate

Envelope Circuits: a simple discrete AR design

As a companion to my simple op-amp AR envelope circuit, here’s a discrete version. It has the same basic functionality – gated input, variable attack and release times – but is made with transistors instead of integrated circuits. Power consumption is very low (just a handful of mA), and it runs from a positive supply of your own choosing. Like its op-amp cousin, it could be powered with a battery, or in a Eurorack system, or you could add it into an existing synth like the Moog Werkstatt as a mod.

The main difference between this and the op-amp circuit, aside from it being discrete, is that I have included a very simple way to set the level of the envelope output (see below for details).

RV1 is Release, RV2 is Attack. The Gate input can be anything over a couple of volts. Negative-going inputs (eg., from a bipolar LFO) will be removed by D1. The output goes to nominally 0V when fully off (closer than the op-amp version, in fact).

Discrete AR envelope schematic

Discrete AR envelope schematic

Parts List

R1, R2, R6, R7, R10: 100k
R3, R4: 47k
R5, R8: 560 Ohm
R9: 24k
R11: 10k
R12: 1k
RV1, RV2: 1M linear pot
C1: 1µ non-polarized
D1, D2, D3: 1N4148 or equivalent
Q1, Q4, Q5: BC549C or equivalent
Q2, Q3: BC559C or equivalent

*

How it works

Compare the first pair of transistors with my discrete gate buffer circuit. A positive voltage on the input turns on Q1, taking the base of Q2 low. This turns on Q2, taking its collector high. This is how we drive our envelope.

Now compare the diode and potentiometer arrangement with my op-amp AR. Once you’re past the transistors, it works in basically the same way.

Q3 inverts the output of Q2, so when Q2 is on, Q3 is off, and vice versa. When the collector of Q2 is high, the capacitor charges through diode D3 and pot RV2 (Attack). When the gate input goes low, the transistors Q1-3 switch off, off, and on, respectively. In this state, the capacitor discharges through RV1 (Release) and D2.

Note the two 560 ohm resistors: one on the emitter of Q2, the other on the collector of Q3. When the gate input is high and the capacitor is charging, current flows through Q2’s emitter resistor; when the gate is off and the capacitor is discharging, current flows through Q3’s collector resistor. These two resistors put a lid on the current flow and limit the fastest times for Attack and Release. The value is a trade-off between current and snappiness. With the values shown, maximum current through these resistors is around 16mA and the fastest rise and fall times of the envelope are around 2ms.

The final two transistors in the circuit after the capacitor are the output buffer; notice the two resistors between them, forming a potential divider. With the values shown, if you run this circuit on 12V, the envelope output will be around 8V max.

There are better ways to set the peak level of an envelope, but my aim here is to keep things simple as a base for experiment.

Changes

The most obvious things to tweak are the envelope times and the output level.

The values of the two potentiometers affect the attack and release times, but the envelope can be substantially stretched by using a larger capacitor. It would be easy to add a switch that connected, say, a 4.7µF or 10µF capacitor in parallel with the existing one, which would multiply the envelope’s times substantially (use perhaps a 25V electrolytic, with its -ve terminal to ground).

The two resistors between the output buffer transistors can be adjusted to suit your requirements. If you want full-scale output (ie., envelope peak closer to the supply voltage), remove R9 and R10, and connect the emitter of Q4 directly to the base of Q5. In fact, this circuit will also work with just a single NPN as a buffer (miss out Q4 and the divider resistors, connect the cap to the base of Q5), but amongst other things the ‘zero’ value is less close to actual zero; if you want to experiment with a single transistor here, setting the level of the output can be done by replacing the 10k resistor on its emitter with a pair of resistors as a potential divider, or even a 10k trimmer with the output taken from the wiper.

Feel free to experiment with the circuit in Falstad’s handy online simulator.

 

Synth DIY: Gate Buffer

One of the simplest DIY utility circuits you can build is a gate buffer: you put a gate signal into one end, and get a gate signal out of the other.

Although this might sound unnecessary, there are several reasons you might want a gate buffer:

  • compatibility problems between gate/trigger inputs and outputs on different equipment: see my page on the Arturia Beatstep, for example
  • the need to trigger multiple devices from one source: passive splitter cables or mults sometimes result in signal loss and therefore unreliable triggering
  • tightening up the edges of gates/triggers: for various technical reasons, some trigger outputs are relatively slow to rise and/or fall; in a worst-case scenario, this can skew the timing of down-line devices. A buffer with multiple outputs can deliver a set of tight, sharp pulses simultaneously.

I offer two simple designs here, one using discrete components, the other using an op amp. Both require just a handful of parts, both will run off a wide range of DC supply, including a 9V battery, and both can be made very compact if you ever want to include them inside another piece of equipment as part of a build or mod.

*

Discrete (transistor) Buffer

The transistor buffer is a two-stage circuit, with each stage inverting the incoming signal.

Think of a gate signal as a logic on, or a logic off. When there is no gate present, the first transistor is held off by its base resistor. The base of the second transistor is therefore tied to +V by the two 47k resistors; as it is a PNP type, it is therefore off, and the output is held low.

Conversely, when the input is high, the first transistor is switched on, and the base of the second transistor is taken low. This pushes the second transistor into conduction, and the output is taken high.

Precise voltage levels depend upon the level of the gate signal going in, and the positive supply rail. The circuit will operate on a wide range of positive DC supply: in a 5V logic circuit, from a 9V battery, a 12V or 15V rail in a Eurorack system, etc. The input resistors and diode provide input protection; so, for example, you can send a bipolar square LFO into it with no ill effects, or use it to make a reliable 9V gate from a 15V one without the impedance issues of a simple passive potential divider. It will also allow you to increase a low gate to a high one, so you could (for example) run a 5V signal into this, powered on an existing 15V rail, and get a 15V gate out. With a standard signal diode and two normal low-power transistors, you can trigger this circuit with just a couple of volts.

Gate Buffer using Transistors

Gate Buffer: Transistor version

*

Op Amp Buffer

The op amp version of this gate buffer circuit consists of a single op amp stage set up as a comparator: one voltage is compared to another, and the output goes high or low depending which input is the higher.

The potential divider at the inverting input provides our reference voltage. The non-inverting input takes the external gate signal we want to buffer.

When there is no gate signal, or it is low, the inverting input is higher, and the output is therefore low. When the gate signal is high, the non-inverting input is higher, and the output is high.

Gate buffer: op amp version

Gate buffer: op amp version

The circuit is designed to run from a single-sided supply, ie. ground and positive. For this purpose, an op amp such as the LM158/358/324 (single, dual, and quad versions respectively) is suitable as the low output state goes to the 0V rail. Their high output state is around 1.5V below positive supply.

The voltage reference provided by the potential divider at the inverting input should be adjusted for purpose: using a 9V supply, the values given will trigger the comparator at around 1.6V; even with a low battery, this circuit should trigger around 1.2V. With a 12V or 15V supply, replace the 18k resistor with something in the region of 10k-15k. This would keep the trigger level around 2V or a little lower, which is high enough to be a clear ‘on’ signal, but not so low as to be confused with a slightly high ‘off’ signal (the Arturia Beatstep ‘off’ gate signal hovers around 0.6V, for example).

It would be possible to use a dual-rail op amp just as well, which would require the addition of a diode on the output to clip the negative-going signal.

I have used an op amp here rather than a dedicated comparator; devices such as the 311 cannot be directly substituted in this circuit.

Moog Werkstatt: adding a proper Gate input

Note: I make reference to the Moog Werkstatt schematics throughout. Copyright prevents me reposting them here; they can be found on Moog’s website.

In its original form, the Werkstatt’s own keyboard generates the Gate signal to trigger the envelope, and there is no obvious ‘Gate Input’ on the header. The existing Gate Out can be (ab?)used as a Gate In, but it’s not ideal, because as with most of these header points, anything coming in here isn’t buffered from the internal signal.

Adding a proper Gate In to the Werkstatt is straightforward enough, though a little more involved than the CV input; my approach doesn’t require the cutting of any traces, the only hack-work being the hole in the enclosure for a jack socket. It does require the end of one wire to be soldered to rather small SMT (surface-mount) components though, so you’ll need a suitably fine tip for your iron and a steady hand.

Werkstatt gate mod schematic

Werkstatt Gate Input mod schematic

 

How it Works

The Werkstatt’s keyboard scanner outputs a logic high at U19 pin 3 when it detects a key press. As well as stopping the scan and loading the current key value into a latch (which feeds the VCO CV), this signal is buffered to provide a Gate, and differentiated to provide a Trigger. The Key On signal is buffered inversely by the Schmitt trigger of U14-F before being flipped back positive by U14-D. In order to add our external gate without affecting any other part of the keyboard circuit, we only need to bring the input of U14-D low. In this way, we can use both the Werkstatt’s own keyboard and an external Gate without having to switch between control sources.

The solution is to use a simple NPN in saturation to take U14 pin 9 to ground when its base is taken high. In other words, a positive external Gate will take the gate inverter input low, just as does the keyboard gate detector. Because there is a diode in the way (D14), our added transistor is isolated from the keyboard scanner clock and data-bus, so there won’t be any accidental mis-readings of the keyboard CV.

Another advantage of this solution is that the Werkstatt’s own envelope retains its Gate/Trigger operating modes, as our external Gate also gets differentiated; we are activating the Werkstatt’s envelope, not over-riding it.

The modification takes just four components and a socket, and fits easily on the PCB. The hardest part is soldering the wire from the collector of the transistor to the appropriate point on the Werkstatt’s circuit – I chose to solder it across the connection between R89 and C64, as the two solder points make a convenient place to lay a thin wire and give it a firmer purchase.

I presume you’ll be doing both CV and Gate input mods; the socket ground can be wired to the CV In socket ground, which I wired to a solder tag around the nearby PCB mounting screw (see also the CV Input page).

Werkstatt gate input mod smt solder point

Werkstatt Gate Input mod SMT solder point

 

Werkstatt gate mod extra components highlighted

Werkstatt Gate Input mod extra components highlighted (PCB top)

 

Werkstatt gate mod PCB rear highlighted

Werkstatt Gate Input mod extra components highlighted (PCB rear)

*

Parts Used:

33k 1/4W 1% MF resistor
100k 1/4W 1% MF resistor
1N4148 signal diode
BC549C NPN transistor
1/8” panel mount socket
wire

These parts are what I had handy. Pretty much any NPN with reasonable gain can be used here, and the signal diode is a generic one.

Moog Werkstatt: adding a proper CV input

Note: I make reference to the Moog Werkstatt schematics throughout. Copyright prevents me reposting them here; they can be found on Moog’s website.

The existing header on the Werkstatt allows for a VCO pitch CV to be patched in. Although the pitch can already be modulated by either the LFO or the EG (selected using a panel switch), the patch header input means you can use both modulation sources simultaneously – or an external CV, if you can cable it up.

When you start wanting to connect control sources to the Werkstatt, one problem is pretty obvious: the patch pin header provides a signal path, but there’s no ground. The user manual suggests hacking cables together, taking a ground from the cable to a screw on the case (or the ground on the audio output jack), but this isn’t a very neat solution. Better to add a proper CV input jack so you can directly and simply hook up your external CV source using standard cables.

Moog themselves (at the time of writing) do sell an add-on jack board, which provides both a row of minijacks and a signal ground, but I decided against buying it for two reasons: 1) it still doesn’t offer a true Gate input, which I felt necessary; 2) the jack board replaces the patch pin header – adding mods like mine means you can use them and the patch pins simultaneously, giving more possibilities.

How it Works

The circuit is very simple. Looking at p.2 of the official schematic, we can see the existing header CV input is mixed in via a resistor R46 and trimmer VR5. This trimmer can be carefully adjusted to give a 1V/octave response for your external CV.

It would be super-easy to simply wire a jack to the CV point on the header, but this has the disadvantage that inputs are not isolated from each other. Better (and still easy) is to replicate the two passive components and route them to the same mix point.

Here are my additions to the circuit:

Werkstatt CV modification schematic

Werkstatt CV modification schematic

Here is the mod in situ:

Werkstatt CV input mod (top)

Werkstatt CV input mod (top)

Werkstatt CV input mod, rear

Werkstatt CV input mod (rear)

The handiest solder points for connecting the extra components to the existing circuit are TP14 and TP10. Either will do:

Werkstatt CV input mod routing

Werkstatt CV input mod routing

The jack is wired to be brought to the side panel beneath the header. In this photo the Gate mod jack is also in place. The jack grounds are wired together, and then to a solder tag that connects to the nearby screw post. The existing screw is long enough to accommodate a washer or two:

Werkstatt mod ground point

Werkstatt mod ground point

Drilling the hole in the case is simple and quick, and a label finishes the job:

Werkstatt with CV and Gate mods

Werkstatt with CV and Gate mods

The accompanying Gate Input mod is also detailed on this site.

*

Parts Used

68k 1/4W 1% MF resistor
100k trimmer
1/8” panel mount socket
3mm solder tag
3mm washers (x2)
wire

Yamaha CS Trigger Input Modification

Problem: Yamaha CS not triggering from an external Gate
Solution: small converter circuit

I had a Yamaha CS5 for some time, a neat little monophonic synth with one oscillator, one envelope, switchable HP/BP/LP filter, a simple LFO, white noise, and a single VCA. It has Control Voltage and Trigger input jacks round the back for interfacing with other devices.

The CS series uses a Hz/V (Hertz per Volt) CV, and the better modern MIDI-CV interfaces can handle this with no problem. The Trigger levels are comparatively awkward though, with ‘off’ being nominally +3 to +15V, and ‘on’ being nominally 0 to -10V. I say ‘nominally’, because the outputs of these CS synths are stated as +3V for off, -7V for on.

Why is this awkward? Well, there are two other common systems – Positive Gate (aka V-Trig), and Short to Ground (aka S-Trig), which I shall not discuss here – and whereas the other systems have been employed by several manufacturers, Yamaha was, and is, on its own with theirs. Though many CV interfaces are stated as being compatible with Yamaha CS synths, I have found this not to be reliably the case.

The problem comes when a Short to Ground signal will not trigger a Yamaha Gate. For whatever reason, some units just don’t provide a good enough trigger output to correctly pull down the inputs of some Yamaha CS triggers. I suspect a number of things, but won’t speculate here as I found an easy and practical solution.

*

I owned both a CS5 and CS15, which use very similar, but not identical, trigger input circuits. My Kenton Pro-2 MIDI-CV interface would trigger the 15, but not the 5.

The Pro-2 is an older model, and has been long superceded by better units, but at the time I wanted to get the Kenton and the CS5 working correctly. My solution was to build a small buffer board and install it in the Kenton, adding a separate Trigger Out jack on the Kenton specifically designed for Yamaha’s system.

It works very simply. The Kenton provides a +15 Positive Gate by default. Its own subsequent conversion to S-Trig being insufficient, I added to the V-Trig output a single op-amp with a few resistors to provide both offset and scaling of the signal, transforming it into the ‘correct’ +3/-7V, and routed the new Trigger output to its own ‘CS-Trig’ jack socket. The schematic can be found below in both JPEG and PDF formats.

The circuit can be built onto a small piece of stripboard; I used a TL072 as it’s what I had to hand, but almost any op-amp will do. Mine was powered from the dual +15/-15 supply rails in the Kenton, but you could equally well install it within your CS synth if desired – just pay attention to where in the circuit you install it. Perhaps add a second jack for this input if you wish to leave the original in place (for example, if you wish to run your badly-triggering CS from another CS). Another option would be to install a switch to select the type of Gate input being used. That’s up to you; I present only the basic circuit that converts one gate to another.

NB: actual output values are 3.74V for ‘off’ and -6.45V for ‘on’, but they are within tolerance and much closer to Yamaha spec than the regular S-Trig.

*

Schematic for a V-Trig to Yamaha CS-Trig converter

Schematic for a V-Trig to Yamaha CS-Trig converter

PDF version: CS Trig schematic

Here are a couple of photographs of the extra board in situ in the Kenton Pro-2. Note the angled PCB at the bottom left is Kenton’s own optional Hz/V CV board (from the factory the Pro-2 only provided V/Oct CV). My extra circuit is mounted on the small piece of stripboard at top left. It takes power from the Kenton’s 15V rails, and takes its trigger input from the Kenton’s V-Trig +15V Gate, and it outputs a near-Yamaha-spec +3/-7V off/on gate signal to a dedicated jack socket which I added myself. The unused half of the dual op-amp is not connected to anything other than 0V and itself, as indicated on the schematic. If you use a single or even quad op-amp in this circuit, re-arranging the pin-out is up to you.

V-Trig to CS-Trig convertor installed in Kenton Pro-2

V-Trig to CS-Trig convertor installed in Kenton Pro-2

V-Trig to CS-Trig convertor installed in Kenton Pro-2, detail

V-Trig to CS-Trig convertor installed in Kenton Pro-2, detail

 

%d bloggers like this: