« Back to DIY

UNVERIFIED. Drawn by my own layout script and checked in Copper Bottom, not built. The netlist was written from the design and the board was checked against it, and the editor's checks come back clean, but nobody has soldered this board or heard it. Every frequency on this page is arithmetic, not a measurement.

XOR Cross-Mod

Three pitch knobs, one toggle, digital ring modulation · By Onion Madder · Mess O' Pedals

An XOR gate is a ring modulator for square waves: its output is high when its two inputs differ, so feed it two oscillators and out comes the sum and the difference of their pitches and none of the originals, metallic and bell-like when the two are close, a clang when they are not. This board is three 40106 oscillators on three pitch knobs and two gates of a CD4070. The first gate XORs oscillators 1 and 2. The second XORs that result with oscillator 3. A toggle picks which of the two you hear, so it is two voices cross-modulated, or all three, and with three knobs the beating between them is the instrument. Smallest board of the six.

The XOR Cross-Mod layout drawn as a stripboard diagram, titled XOR Cross-Mod, 27 by 16 stripboard. Sixteen orange copper strips run left to right, lettered a to p, with 27 numbered columns. Two pale rectangles sit one above the other to the right of center: U1 CD40106 on the upper strips and U2 CD4070 on the lower ones, each with gray X marks through the strips under it. Four outlined resistors marked R1 to R4 stand between the strips, small green ceramic capacitors marked C1, C2, C3, C5 and C6, pink round electrolytics marked C4 and C7, a diode marked D1 at the top right and dark blue wire links. Pads carrying wires off the board are labeled T1, P1, T2, P2, T3, P3, SEL_A, SEL_B, GND2, MIX and OUT down the left and +9V and GND on the right. Around the board the panel parts are drawn with a wire to each hole: three B500K pots marked POT1 to POT3, an A100K pot marked POT4, an SPDT toggle marked SW2, a quarter-inch jack marked JK1 on the left, and a DC jack and an SPST toggle marked SW1 on the right. Below it the same board from the solder side, mirrored, the columns numbered right to left, every solder point a dark dot, the cuts as X marks and the two chips as dashed outlines with pin 1 boxed. A parts list follows, then a block headed OFF THE BOARD listing each panel part, what it does and where each leg goes.
The board as Copper Bottom draws it: the component side on top, then the same board from the solder side with the columns running the other way, so a cut is the same hole in both pictures. The panel parts sit around the board with a wire to every pad, and the OFF THE BOARD block at the bottom says where each leg goes.

What you'll need

tap to expand / collapse

Twelve parts on the board plus the links, and eight off it.

  • 1× CD40106 hex Schmitt inverter, DIP-14 (U1) - spot it: fourteen legs, the number printed on top, a notch at one end. Three gates are the three oscillators; the other three are tied off. Fit a socket
  • 1× CD4070 quad XOR, DIP-14 (U2) - spot it: fourteen legs, notch at one end. Two gates used, two tied off. A CD4030 is the same thing under an older number. Fit a socket
  • 1× 1N5817 Schottky (D1) - spot it: fat black body, a gray band at one end. Reverse-polarity protection on the supply
  • 1× 100K resistor (R4) - spot it: bands brown-black-yellow. Ties the output to ground so the level pot has something to sit on
  • 3× 1K resistor (R1, R2, R3) - spot it: bands brown-black-red. One in series with each pitch pot, so an oscillator can never see zero ohms
  • 2× 47nF ceramic (C1, C2) - spot it: printed 473. The timing caps for oscillators 1 and 2. Equal, so the two knobs cover the same range
  • 3× 100nF ceramic (C3, C5, C6) - spot it: printed 104. C3 is oscillator 3's timing cap, twice the other two, so its knob sits an octave lower; C5 and C6 decouple the chips
  • 1× 1 µF electrolytic (C4) - spot it: a small can with a stripe down one side; the stripe leg is the negative one. The output coupling cap. Stripe toward the level pot
  • 1× 100 µF electrolytic (C7) - spot it: a small can with a stripe down one side; the stripe leg is the negative one. The supply reservoir. Stripe to ground
  • 16× wire links - offcuts of component leg
  • 2× DIP-14 sockets

Off the board

  • 3× B500K linear pots - pitch 1, 2 and 3. Variable resistors: lug 3 to P1, P2 or P3, wiper to T1, T2 or T3, wiper jumpered to lug 1. The 1K each needs is on the board
  • 1× A100K log pot - level. Lug 3 to OUT, lug 1 to GND2, wiper to the output jack tip
  • 1× SPDT toggle - voices. Center to MIX; one side to SEL_A for oscillators 1 and 2, the other to SEL_B for all three
  • 1× 1/4 inch jack - out. Tip to the level wiper, sleeve to GND2
  • 1× DC jack, 9 V center negative
  • An SPST toggle for power, in the positive supply lead between the DC jack and the board's +9V pad. Every build on this shelf gets one, and the drawing above shows it

The layout file is the guide

Like every layout on this shelf, the build document for this one is the file itself: ↓ Download XOR_Cross_Mod.json - import it into Copper Bottom and the editor gives you the board picture, the placement walkthrough, the electrical checks and a printable build sheet, all from the same file. No coordinates are written out on this page on purpose: the editor is the viewer, and a number typed twice is a number that can drift.

The two chips stand one above the other, the 40106 on the upper strips and the 4070 on the lower, so the board is nearly square. Strip n carries ground, with the GND and GND2 pads at either end, and the 4070's ground pin sits straight on it. Every pad but the supply is down the left edge, so the pots and the toggle all wire to one side.

The netlist

My script wrote this from the design and the board was checked against it in Copper Bottom: every connection it names is on the board and nothing on the board is missing from it. Three lines are the whole circuit: O1, O2 and O3, each an oscillator's output going to its 1K, its XOR input, and nowhere else. X12 is the first XOR's output, on the toggle and into the second gate; X123 is the second's, on the toggle alone.

The off-board wiring

Thirteen pads leave the board: three pitch pots, the level pot, the toggle, the jack and the supply.

PadGoes to
P1 / T1, P2 / T2, P3 / T3The three B500K pitch pots. Lug 3 to P, wiper to T, wiper jumpered to lug 1. Variable resistors; R1, R2 and R3 are their 1K floors
MIX / SEL_A / SEL_BThe voices toggle. Center to MIX, which is the output coupling cap. SEL_A is oscillators 1 and 2 through one XOR; SEL_B is that result through a second XOR with oscillator 3
OUTLevel pot lug 3. The wiper goes to the output jack tip, and lug 1 to GND2
GND2Level pot lug 1 and the jack sleeve. Same net as GND
+9V / GNDThe supply, through the power toggle. DC jack positive to the toggle and the toggle to +9V; negative to GND

How it works, in one breath

Three gates of the 40106 are three oscillators, each a 500K pot plus 1K back from its output to its input with a cap to ground: 47n on the first two, 100n on the third, so the third knob sits about an octave below the others over the same travel. Oscillator 1 goes to one input of the first XOR gate and oscillator 2 to the other. An XOR is high only when its inputs differ, so when the two square waves are at the same pitch and in step the output is silence, and as they drift apart the output flickers between them at the rate they beat: that flicker is the difference frequency, and the sum is in there too. It is exactly what a ring modulator does to two sine waves, done to squares with one gate.

The first gate's output goes to the toggle and also into the second gate, where oscillator 3 is the other input, so the second gate's output is all three cross-modulated. The toggle picks one or the other, C4 blocks the DC, and the level pot sets how much leaves. There is no mixing of the raw oscillators anywhere on the board: you never hear the three pitches, only what they do to each other, which is why the knobs feel nothing like tuning. That is what the schematic does, and it is a read of the circuit, not of a build.

Things to try

None of these have been tried, because none of this has. They are the obvious knobs.

  • Mix the raw oscillators in. A 100K from O1, O2 or O3 to MIX puts a fundamental under the clang
  • Change C3 to 470n and oscillator 3 becomes an LFO, and the toggle's second position is a tremolo on the first two
  • Use the other two XOR gates. Pins 8 and 9 in, 10 out, and 12 and 13 in, 11 out, are sitting on ground waiting
  • Send it to the CMOS Ladder Filter, which likes exactly this kind of signal

An XOR as a ring modulator for square waves is the standard Lunetta trick and belongs to everyone who has ever built one. Chaining two of them behind a toggle, and the layout, are mine and so is anything wrong with them.