Eurorack, Modular

Designing an Envelope Detector for Bass and Bass Drum Signals

The neat thing about rolling yer own eurorack modules is that any niche requirement you can dream of can be realised (with the required time, effort and aptitude of course!). I almost always send my kick drum signal to my l-1 compressor sidechain to ‘duck’ my bass voice(s). The l-1 has 2 CV outs that can be processed (invert +offset + gain) to ‘duck’ other signals too. This approach works fine but is an awful waste of a good compressor. I’d like to experiment more with controlling the synth with my bass so an envelope detector design that can handle 50Hz+ signals to a decent approximation seemed like a good idea.

The classic analogue Envelope Follower/Detector is a precision full-wave rectifier followed by a low-pass filter. The rectifier gets rid of the negative portion of the input signal and is usually full-wave rather than half-wave because the frequency doubling effect eases the filter design at very little extra cost. I’ve linked an excellent precision rectifier study from Elliot Sound below – I used the circuit in figure 6. The low pass filter averages the signal and it is in the design of the filter that a trade-off must be made between a fast response and minimal 3rd harmonic ‘ripple’ that could distort the vca or filter signal that is being modulated by the envelope. A filter with a fast time constant (say 10 ms) will respond rapidly to transients but is likely to have unacceptable levels of ripple especially at lower frequencies (doh); a slow time constant (say 110 ms) solves the ripple issue but may not keep up well with the input signal. Is it possible to achieve acceptably low ripple (~20 mV at 50 Hz for a 5 Vp input) and fast attack (>50% in 20 ms) using a small handfull of common parts…well yes A’bhalaich! Introducing the Non Linear Capacitor (NLC) – an adaptive time constant approach in which the capacitance of the capacitor in a 1st order low pass filter appears larger to lower frequency signals by exploiting the Miller Effect. To the engineer(s) at THATcorp who seem to have invented this circuit I say Slainte! After simulating various filters I thought the NLC offered a good complexity/component count/performance trade-off compared with higher order filters.

In simulation I found that some additional low pass filtering was required to smooth the waveform, so a 2nd order Sallen-Key Butterworth filter with a cutoff of 32 Hz was added in series with the ‘NLC’ filter. Also it’s often desirable to manually play with the attack and release times which is what the diode steering circuitry following the 32Hz filter is for. This feature has the added benefit of getting me out of jail if the adaptive filtering doesn’t perform as well as in the simulator. Output ‘VenvOut’ is the standard envelope out, after attack and release controls. Output ‘VenvDuckCV’ is the inverted and offsetted ‘duck’ CV out, included to avoid needing additional processing before feeding a vca (or 2). The dc offset level is adjustable using the pot connected to the non-inverting input of the Invert and Offset pot. The final output is a gate that goes high whenever the signal at the attack/release output exceeds the adjustable dc threshold level. The status LED lights up when the gate signal is high.

The Spice plot below compares three different filter responses to a rectified bass drum sample: the adaptive NLC filter; a single order ‘slow’ filter and a single-order ‘fast’ filter.

I looked at using a fourth order filter, which could offered similar attack and ripple performance with only one additional opamp however the err sharper overshoot looked like a potential issue unless even higher order Bessel filters were used.

Here’s the build; I used the eurorack format prototype boards by D.Hailant now available at Thonk. These are good and although this is about as large a circuit you can fit on one without getting silly I can see myself using 2 or 3 of these for a more complex module, they’re cheap enough and the design, hole placement and footprints for pots, jacks etc well thought out.

‘Scope Measurements

So how does the performance of the build compare with the simulation results? Well the rise, fall, overshoot and ripple were all a bit better in simulation, but not massively – measurements are included beneath each plot. Perhaps some tweaking of the NLC circuit could tighten things up but it’s not too shabby as is.

Input: 2Vpp Sine, 50 Hz
Output: Env Out
Att/Rel: Fully CCW

Input: 2Vpp Sine, 2.5 kHz
Output: Env Out
Att/Rel: Fully CCW

Input: 2Vpp Sine, 660 Hz
Output: Env Out
Att/Rel: Both ~50%

Input: 2Vpp Sine, 330 Hz
Output: Env Out
Att/Rel: Fully CCW

Input: 6V Sine, 400 Hz
Output: Duck CV out
Att/Rel: Fully CCW

Input: 10Vpp Sine, 660 Hz
Output: Gate Out

Suggested Improvements

There are alternative envelope follower designs out there – one of them by Harry Bissel is linked below and is likely to have a better response and possibly less ripple, by using (min) 3 peak detectors and some clock/reset CMOS to reset them. I might try this one in the future.

The performance of the detector could be improved by tweaking the NLC circuit – try different diodes and capacitor values. See the THATcorp link for more info on this.

An i put and/or output gain control would be useful, particularly for better control if you intend to fully (/properly) use this for ducking.

I used a polymer electrolytic for the first time here, although forgot to buy them for the power filtering. Having recently replaced over a ton of dried up and leaky caps in an old Boss Multi FX I like the idea of not having to repeat this for all my modules in the future!

Links

http://sound-au.com/appnotes/an001.htm
Precision rectifiers.

http://www.thatcorp.com/datashts/dn114.pdf
The non-linear capacitor circuit

https://www.thonk.co.uk/shop/david-haillant-euro-stripboard-pcb/
Eurorack format prototyping board

https://www.allaboutcircuits.com/technical-articles/ltspice-simulation-using-wav-files/LTSpice allows you not only to specify a wav file as a signal source but will also write signals to a wav. This is really neat for analogue effects simulation!

https://www.edn.com/design/analog/4344656/Envelope-follower-combines-fast-response-low-ripple

Peak detector based Envelope Detector for fast response and low ripple

https://www.youtube.com/watch?v=6cv1XADgyKE

Standard
Guitar Pedal

Dynamic Fuzz Guitar Pedal Circuit

I sometimes hack together a music device for friends or family as Christmas or Birthday pressie. Here’s one from a couple of years ago that I made for my wee bro. I’ve dug out the schematic to remind myself how it works, as I’m looking at using the THAT4315 ic for a new design.

The concept was inspired by a ‘moosapatamus’ blog post about an RA Penfold circuit (link at bottom). It’s a fuzz effect that is shaped by an amplitude envelope that tracks the pre-fuzz input. This is cool because it allows you to set a high overdrive and manipulate the volume of the fuzzy sound with your pickin hand. As a bonus the circuit is also an expander / noise gate – a useful feature in a high gain circuit. For a bit of fun I added the option to slew the attack and release times up to the order of seconds. The attack control is cool for auto-volume-swell weirdness, the release control not so much!

See the (deadTreeCAD) schematic above for my take on the circuit, based on the THAT4315 compressor-on-a-chip with an onboard VCA and RMS envelope detector. The 4315 is suitable for the standard 9V supply and generally well matched to this circuit. THATcorp have a good selection of app notes and some 9V guitar pedal specific designs (linked below) – I may have borrowed an idea or 2 from the THAT4316 ‘1 knob squeezer'(!) design guide.

The components around U4C(what happened to U3?!) provide a high impedance, ac coupled buffered input stage with 6 dB gain. The signal is then sent to both an overdrive stage for the clipping and an envelope detector that will generate the control signal for the VCA.

In the audio signal path – U4C is a typical ‘soft’ limiter with variable gain to in the feedback loop to push more volts through the clipping diodes. As always diode choice and quantity are ripe for experimentation – I’ve gone for cheap n cheerful 1N4148s with asymmetric clipping here. The distorted signal is sent to the 4315 VCA – the VCA is current output so U4D is required. The output is ac coupled to remove the 4.5V bias voltage and the output impedance is set by the components following U4D.

In the control signal path – The 4315 extracts the rms envelope of the conditioned input audio signal. The 6k8 Ohm resistor sets the threshold to… The 22u cap hanging off the timing capacitor should be placed close to the CT ground junction to help avoid cv signal coupling with the audio signal. The 2u2 timing cap gives a time constant of approximately 8ms which is good and fast for responding to transients however for low frequency steady state signals, there is a risk of excessive distortion due to ripple in the rms output modulating the audio input – a 10u cap here would be a better middle of the road value, maybe 22u for bass duties. The best approach is an NLC (non-linear capacitor) – a circuit that presents a frequency dependant capacitance to achieve fast response (low capacitance) to higher frequencies and low ripple for lower frequencies, check out the thatcorp pedal link for more info on this.

The rms envelope output is processed by the circuit around U2A /U2B – this provides control of the attack and release rates of the control signal. I think I first noticed this approach on a that4301 compressor circuit credited to Harry Bissel but can’t find the schematic – do check out the Harry Bissel ‘Morph Lag’ for a neat version with lin/log response control and inverted cv out. Anyway, it works like this: because the output of 2B is fed back to the inverting input of 2A, as the input signal goes more positive the 47u cap gets charged up via the attack pot. When the input is negative with respect to the 2B output the cap discharges through the release pot – simple as that! The ‘steering’ diodes provide some degree of independance between the attack and release pots. Most modern op-amps will work here but the slew rate must be greater than ~1 MHz for the circuit to function correctly.

The 4315 VCA gain control is 6mV/dB and I didn’t find that any additional Control voltage processing was necessary after the lag circuit for decent sounding results.

The THAT4315 can be made thru-hole by attaching to a 16 pin qsop adapter. The component choices look to be a bits box special!

Suggested Improvements

Post clipping EQ control – clipped signals are rich in harmonics and really shine when you can shape those harmonics to taste – very little effort was put in to optimising the frequency response or offering tone control here. Check out Electric Druid’s design walkthrough for the ‘Hard Bargain’ pedal for some cool fuzz tone control ideas.

Timing Cap – use 10u here or better still an NLC circuit a la 1 knob squeeeezr

Capacitor in U4C feedback loop – IIRC I added a capacitor here to attenuate higher frequencies at high gain settings (cutoff down to ~5 kHz at full ‘Drive’ pot setting).

Output Volume – always useful!

Effects send/return – to make best use of the noise gate feature and to maximise control over the VCA, the pedal is best employed early in the signal chain. Adding an effects send/return loop in the audio signal chain would better suit larger rigs.

CV input – for optional volume pedal or feed the vca an lfo for tremolo.

Links

Penfold Fuzz Circuit (moosapatamus)

Electric Druid ‘Hard Bargain’ design

THATcorp pedal page

Harry Bissel Morph Lag

Standard
Eurorack

Hello World

..wide web.

This is a wee blog to help me keep track of my synth and music/elechronics projects and ideas.

A brief overview of my current setup:

The heart is a modular synthesizer in the ubiquitous eurorack (doepfer a-100) format.

Case: 3u 104hp

// The case is a Laser cut mdf flat packed type from GinkoSynthese. These are no longer available on the ginkosynthese website however a user called nathnxl has kindly shared similar plans on the muffwigler forum that can be sent to yer local LaserCutting shop.

PSU: RS branded RT65-B. I know…

Modules are a mix of panels/pcbs from the usual UK and European sources (thonk, pusherman etc.) some of my own and some based on internet found circuits. The latest addition in Per|former by Westlicht – a powerful and well thought out sequencer that also has midi io. I might do a separate page for this in time but in short the UI (hard and soft) design, feature set and component choices (that screen man) are really cool. Although not a simple build with 0603 passives and a relatively high component count, the documentation and resources available such as iBom, software simulator(!) and hardware test firmware are a great example of how to do a complex diy project well.

Outside the modular I’ve got a Music from Outer Space (MFOS) Soundlab mk2 by synthDiy inspiration Ray Wilson (RIP). This is a nice semi-modular synth that’s great for yer classic subtractive sounds. It’s v/oct with 12v bipolar supply so integrates well with the eurorack with the necessary cable adaptions.

Drum sounds are from the Sonic Potions LXR digital drum synthesizer which has does proper drum synthesis. The trigger i/o extension gives you 3v trigger signals and clock i/o. The sequencer has probability functions and randomness (or periodic control signals) can be added to any of the voices by 6 available lfos.

The mixer/interface is a Alesis multimix 8 fx usb 2.0 – I underline the 2.0 as this is the version with mutitrack recording.

Here’s a mix of some sounds generated by the system Continue reading

Standard