Eurorack module design: Compara4

I made another original module for my synthesizer! It’s called Compara4 and it’s a quad comparator / logic in 6hp for the Eurorack format. So far only one exists, I built it on prototyping board. I’ll outline some of the design ideas and lessons learned; maybe someone else would like to build one!

There aren’t any audio/video demos yet, need to figure out a workflow for that…

Compara4 synthesizer module standing upright. An aluminium panel is labelled with 9 input/output jacks, a switch and a large control knob. A circuit board is seen extending behind the panel, with colourful wires and black chips


While Llama Llama Duck is designed as several simple independent sections chained together, Compara4 is the opposite: a more tangled set of functions which can reduce to simpler purposes by leaving some inputs/outputs unused. So this fairly compact module can be a comparator, a gate-combiner, an inverter… or an interesting combination of the above, which will turn multiple modulation inputs into streams of gates.

Block diagram: four inputs are compared with a common threshold before processing to provide four different logic outputs.

The OR output is high when any input is positive, while XOR is high when an odd number of inputs are positive. Complementary NOR/XNOR outputs are provided, and for an additional variation the fourth comparator output can be inverted.

The concept was partly inspired by my need for a gate combiner; I also didn’t have a comparator, which seems a useful building-block in general. Further encouragement came from the realisation that comparators are basically “free”: most Eurorack inputs use some kind of op-amp buffer to set the input impedance and avoid unexpected interactions between modules. The input buffer can be converted to comparator simply by moving resistors around; a cheap TL074 chip provides four comparators. Modular synth electronics should be voltage-controllable where possible to allow automatic modulation. Some circuits (e.g. filters) are tricky to modify for voltage control, replacing resistors with inconsistent optical elements or redesigning to allow current-control with an OTA (probably at lower signal voltages). But comparators are easy; the threshold is set by high-impedance voltage input.


The schematics were drawn up with KiCad and are available on Github. Here’s a PDF version. It’s really quite similar to the block diagram, but a few implementation details are worth discussing.

Extract from electronic schematic. Lots of resistors, diodes, op-amps and XOR logic.
Compara4 schematic extract, showing comparators, NOT, OR and XOR sections.

The TL074 comparator section runs on +/- 12V. A quirk of the TL07x series means that this still isn’t quite able to handle the full range of possible input voltage; these ICs handle extreme negative voltages poorly, so 47k resistor pairs act to a) set a ~100K input impedance b) halve the voltages. The threshold is also divided this way (on the other sheet) so the comparison is consistent, but a bit of error will be accumulated from component tolerances.

The following CMOS logic chips run on 0-12V, so a set of diodes and pulldown resistors limit the comparator output voltages to a safe range. The OR logic is then achieved by a set of parallel diodes; if any channel is high, this voltage will pass the diodes without contaminating other “low” channels. The 4-way XOR is achieved with a CD4070 chip, which is a quad 2-way-XOR package. Three of these are cascaded to give a 4-input XOR; the remaining XOR is used to implement a switchable NOT for the fourth channel. (Logic is pretty neat, apparently you can build anything with enough NAND gates. Should try that some time…)

Finally, another CMOS chip is used for the outputs: a CD4041 “quad complementary logic buffer”. Each section takes one input, and outputs one “high” and one “low”, which switch places depending on the input state. As well as deriving our NOR/XNOR outputs, these make quite elegant bipolar LED drivers. This is illustrated with a pair of LEDs, but Compara4 uses a single bipolar LED package which encapsulates such a pair in one bulb. I had a useful discussion with some Modwiggler users about the safety of exposing the CMOS outputs to Eurorack without another buffer stage; we concluded that it’s probably ok, but… uh… use at your own risk. Protection with diodes/transistors is possible but adds complexity and may be unnecessary. It was also suggested that maybe circuits like this one could operate at mostly 5V for energy efficiency. Something to play with in future?

Complementary buffers as bipolar LED drivers

Layout and finishing

A lesson learned from Llama Llama Duck was to try planning the layout for designs of similar or greater complexity. Also, while I enjoyed using the Sourcery board I wanted to allow a bit more space and get some experience with traditional hole-per-pad “perfboard”. This helpful article shows how the KiCad PCB design features can be used to figure out a stripboard layout; just stick to the appropriate grid, use wide tracks and keep to some rules about spacing and directions of connections. I adapted the idea to develop a perfboard layout; non-vertical jumpers on the upper side and non-horizontal connections on the lower side are now permitted, but straight lines are still preferred where possible to avoid clutter and make good use of component-lead connections. Even so, the resulting layout is a bit intimidating and I’m very glad it was done with CAD; KiCad indicates which parts should be connected and can run an error report from the schematic, pointing out missing or inappropriate connections. Still, having done this once for perfboard I’m feeling less sceptical about using stripboard for a future project; you can get a lot done with jumpers and it would cut down on fiddly soldering.

Wiring layout with KiCad 6. Both panel and main board are drawn in the same document, for ease of understanding and lining things up. Blue lines indicate copper-side wiring, red lines are jumpers on component-side.

Mostly things get crowded around the three chips, which is understandable as each has four sections, taking inputs from a common direction and sending outputs in a common direction. Typical pin layouts do not facilitate this, so a bit of crossing-over is inevitable! But in KiCad this became quite a satisfying jigsaw puzzle; I can see how PCB design becomes a long refinement process.

The front panel was worked out on paper and refined by plugging components into perfboard, before making a drilling template and transparency graphics in Inkscape. The end result looks pretty professional, but there is supposed to be a shaded rectangle grouping In 4 with the NOT switch and this is very faint. On Llama Llama Duck the shading was a touch dark. More experimentation needed!


I’m really happy with the form factor: 6hp with a big knob and LEDs tucked between two columns of jacks. It’s comfortable to use without much wasted space. It does the intended job as a modulation/logic processor but in practice is also a lot of fun at audio-rate, creating variable-width pulse outputs from sources other than oscillators. (Detuned groups of oscillators make good drones!)

Finished module making some drone music

Eurorack module design: LlamaLlamaDuck, a CD4049-based distortion envelope thing

I started designing my own modular synthesiser components. I wrote a few words here about how that fits into my life. This is my first original module design.

Well, I say original, but let’s give credit where it’s due: this is mostly based on stuff I’ve learned by looking at schematics from Nonlinearcircuits and Mutable Instruments, blog posts by Northern Lights Modular and hanging out on the Modwiggler forum. This particular design is also heavily influenced by some classic guitar pedals.

Llama Llama Duck assembled prototype module. The module is resting on its side and has an aluminium panel with labelled jacks and control knobs. Behind that are circuit boards with various components.


Here is a block diagram of the module. This makes it clear that there are essentially three independent functions, but default “normalled” connections link them together to provide a combined function. This structure is inspired by “Serge” design conventions, in which complementary units are brought together in a single panel, dividing up a regular grid layout of controls and jacks. However while Serge systems use “banana” jacks (which have the advantage of easily stacking to split one output to many inputs), Eurorack uses smaller and more complex 3.5mm jacks which include a “switching” feature to pass a default signal when disconnected.

Block diagram of module:

AC in runs through DC block and soft clipping to AC out.

"DC in 1" and "DC in 2" are summed, run through soft clipping to DC out.

Gate in runs through comparator to release envelope, then Env Out.

Normalled connections are shown with grey dashed lines: AC out is connected to DC in 1, the Release envelope is connected to DC in 2 and a +12V voltage is connected to the Gate In.


So, what’s the deal with the AC/DC clipping stages? Well, I like the idea of the Tube Sound Fuzz, Red Llama and similar guitar distortion circuits, which abuse a CMOS logic chip to create a “tube-like” (soft and asymmetric) distorted gain stage. But guitar pedals have to make a few design compromises; although the input/output signal range is bipolar around 0V, they use a “single-sided” power supply between 0 and 9V (to support the use of convenient batteries). The processing needs to happen about some non-zero reference voltage, with a “bias” shift at the input and output. There’s an easy way of doing this: “AC-couple” the circuit with series capacitors. In the process we filter out the lowest frequencies; a non-issue for electric guitar. In a modular synthesizer this is sometimes a useful side-effect, getting a bit of headroom for unipolar input signals and avoiding excessively asymmetric clipping. The first section of Llama Llama Duck follows this scheme. The manual gain control can be used to dial things back into a kind of AC-coupled buffer, or push into pleasant distortion.

Circuit diagram 1
Section 1 schematic: an AC-coupled distortion section, similar to CD4049-based guitar pedals, is set between inverting opamp buffers which establish typical impedances for a Eurorack system.

Each inverter stage acts as an inverting amplifier when setup in this negative-feedback configuration. The principle is the same as an inverting opamp, making use of a linear region in the middle of the voltage range. There is heavy soft-clipping on one side of the transfer curve; to get something remotely symmetric we use two stages. The chip has six inverters on it, so we may as well use some more…

The joy of modular, for me, comes in the presence of generic processes that make sense for both control-voltage (CV) and audio signals. It should be possible to use distortion to reshape CV, and manipulate audio distortion by injecting interesting modulation sources. The above AC-coupling approach blocks DC and prevents such shenanigans. But the CD4049 can’t handle the full +/-12V Eurorack power supply; either it has to run “single-sided” or we need to regulate e.g. +/-6V rails within the module. I took the approach of dialling in bias voltages with a trimpot. Original experiments used two trimpots, but it turns out that one will do; as long as the output lines up properly (i.e. return 0V for 0V input) it doesn’t matter if the 4049 inputs are slightly off-centre.

Circuit diagram 2
Section 2 schematic: again CD4049-based distortion sits between op-amp buffers. This time there are no AC-coupling capacitors, and a trimpot sets the bias voltage for input and output.

A couple of other details are worth mentioning: a secondary input and clipping diode. Adding DC bias creates all sorts of nice fuzz effects, so an extra input is provided with a level potentiometer. (This works nicely with Section 3, as we shall see.) The diode is a precaution to prevent the U2C input node from being exposed to negative voltages if an unusually low input voltage is supplied. The inverting configuration keeps the node at ~6V but would need a lot of current in such a case. This shows up as a bit of hard-clipping in the output but isn’t really noticeable for sensible inputs.

The gain levels are fixed but fairly useful; a bit over +6dB of gain, and peak levels clipped to around +/-5.5V. This plays well with typical Eurorack oscillator signals which are 10V peak-to-peak. For more gain, consider pre-processing with section 1. For less gain, use the attenuating input.

Release envelope

Section 3 is a simple envelope generator with a fast attack stage, fixed sustain and variable release speed. I came up with it messing around on solderless breadboard but I doubt there’s anything unusual or clever going on: it’s just a comparator and slew limiter.

Circuit diagram 3
Section 3: Envelope generator with fast attack and variable release

An LED indicator is driven by the comparator rather than the output; not really clear if that was a good idea. The timing control uses a 1M linear pot in parallel with a 1M resistor to approximate a 500k logarithmic taper.

Why include a release envelope on a distortion unit, anyway? Well, it’s “normalled” to the DC In 2. If you send a clock to it, this will “fuzz” the audio running through that section’s other input by smashing the signal into one side of the clipping so hard it gets quieter. The result is something a bit like the classic dance music pumping / ducking effect. But weirder and noiser! That’s why this is the “duck” section. And when I realised that would mean the module could be named Llama Llama Duck, well…


After testing with solderless breadboards the circuit was built “freestyle” from the schematic on a Sourcery protoboard. The board was really nice to work with, having a neat power-bus system that allows IC power to be routed by soldering across a few pads. The control board was done with a few bits of regular perfboard, soldering wires and tracks to a header strip. In hindsight this would have gone more easily with a bit more planning; there was a lot of checking back-and-forth between the header strips, and mistakes were awkward to fix where leads crossed over.

Prototype module, side-view showing top of prototype board with components. One of the ICs is a small surface-mount component soldered to an adaptor board. A few jumper cables criss-cross around the board, but generally the layout is dense and tidy.
Prototype circuit on Sourcery Proto board.

The front panel was created as an inkjet waterslide on a drilled Doepfer blank panel. The drilling template and graphics were done with Inkscape. The knob/jack choices partly follow existing conventions in my modular system; I use chunky Bananuts to indicate outputs and knurled nuts for inputs. White knobs are attenuators, black knobs are offsets or direct controls. The waterslide colours ran slightly, turning grey into pink. I don’t really mind, but will try to refine that process a bit… I really like the on-grid section divisions of Serge-style panels and the consistent, informative design of Intellijel panels. I expect my approach will evolve, but for now the principles are: indicate independent sections; indicate normalisation; keep it playable. The ergonomics of knob/jack access are easily overlooked and many modules feel over-crowded.

Finished prototype installed in my modular synthesizer

Apologies if this post made absolutely no sense, it’s more of a DIY build log really. Hopefully there are more to come 😀