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.
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.
- 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.
- 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
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 i between them is left for ground, because a chip's body runs about two millimeters past its end pins and two chips on neighboring strips would sit on each other; the top and bottom strips are ground too, with the GND pad at the top right and GND2 at the bottom right. The pitch pads and the voice toggle's two outer lugs are down the left edge; the toggle's center, the output and the supply are on the right.
The netlist
tap to expand / collapse
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.
| Pad | Goes to |
|---|---|
| P1 / T1, P2 / T2, P3 / T3 | The 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_B | The 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 |
| OUT | Level pot lug 3. The wiper goes to the output jack tip, and lug 1 to GND2 |
| GND2 | Level pot lug 1 and the jack sleeve. Same net as GND |
| +9V / GND | The 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
The same circuit on a breadboard
tap to expand / collapse
Want to hear it before you solder it? This is the layout file above moved onto a half-size breadboard, 30 columns by Copper Bottom's to breadboard button, in 44 steps with exact holes. It is a translation, not a copy: a strip and a breadboard column are different shapes, so every part is placed fresh and the stripboard's wire links are not needed.
Checked by the app, not built by me. Copper Bottom rebuilt the connections from these holes alone and compared them with the stripboard: all 65 terminals land on the same nets. Nobody has built this breadboard version.
Turn the board so the numbers climb left to right. Then A to E is the lower bank, F to J the upper, the top rails are above J and the bottom rails below A.
The semiconductors
| Step | Do |
|---|---|
| 1 | Seat U1 (CD40106) across the center channel, notch to the LEFT: pin 1 in E8, pin 14 in F8. Pins 1-7 run E8 to E14; pins 8-14 run back F14 to F8. Anywhere in the same bank and column is the same point - E8 and A8 are both pin 1. |
| 2 | Seat U2 (CD4070) across the center channel, notch to the LEFT: pin 1 in E18, pin 14 in F18. Pins 1-7 run E18 to E24; pins 8-14 run back F24 to F18. Anywhere in the same bank and column is the same point - E18 and A18 are both pin 1. |
| 3 | Diode D1 (1N5817 DO-41): top + rail to H8. The SECOND hole named gets the banded end - the cathode. Backwards, nothing works at all. |
Jumpers
| Step | Do |
|---|---|
| 4 | Jumper: A14 to the bottom − rail (U1.7 to GND). |
| 5 | Jumper: A24 to the bottom − rail (U2.7 to GND). |
| 6 | Jumper: J9 to the top − rail (U1.13 to GND). |
| 7 | Jumper: J11 to the top − rail (U1.11 to GND). |
| 8 | Jumper: J13 to the top − rail (U1.9 to GND). |
| 9 | Jumper: J19 to the top − rail (U2.13 to GND). |
| 10 | Jumper: J20 to the top − rail (U2.12 to GND). |
| 11 | Jumper: J23 to the top − rail (U2.9 to GND). |
| 12 | Jumper: J24 to the top − rail (U2.8 to GND). |
| 13 | Jumper: J8 to J18 (U1.14 to U2.14). |
| 14 | Jumper: A9 to A18 (R1.B to U2.1). |
| 15 | Jumper: A11 to A19 (R2.B to U2.2). |
| 16 | Jumper: A13 to A23 (R3.B to U2.6). |
| 17 | Jumper: B20 to A22 (@SEL_A to U2.5). |
| 18 | Jumper: tie the top − rail to the bottom − rail at the right-hand end, so they are one rail. |
Resistors
| Step | Do |
|---|---|
| 19 | Resistor R1 (1k): C6 to C9. |
| 20 | Resistor R2 (1k): C7 to C11. |
| 21 | Resistor R3 (1k): C16 to C13. |
| 22 | Resistor R4 (100k): C2 to bottom − rail. |
Ceramics and film
| Step | Do |
|---|---|
| 23 | Cap C1 (47n ceramic MLCC): bottom − rail to C8. |
| 24 | Cap C2 (47n ceramic MLCC): bottom − rail to C10. |
| 25 | Cap C3 (100n ceramic MLCC): bottom − rail to C12. |
| 26 | Cap C5 (100n ceramic MLCC): I8 to top − rail. |
| 27 | Cap C6 (100n ceramic MLCC): G8 to top − rail. |
Electrolytics
| Step | Do |
|---|---|
| 28 | Cap C4 (1u): + leg into B4, − leg into B2. The stripe on the can marks the MINUS leg. Backwards, an electrolytic eventually vents. |
| 29 | Cap C7 (100u): + leg into H18, − leg into the top − rail. |
Off-board
| Step | Do |
|---|---|
| 30 | Wire for MIX: into A4. This is where selector switch center lug joins the board. |
| 31 | Wire for OUT: into A2. This is where level pot lug 3 joins the board. |
| 32 | Wire for P1: into A6. This is where pitch 1 pot lug 3 joins the board. |
| 33 | Wire for P2: into A7. This is where pitch 2 pot lug 3 joins the board. |
| 34 | Wire for P3: into A16. This is where pitch 3 pot lug 3 joins the board. |
| 35 | Wire for SEL_A: into A20. This is where selector switch lug 1 (two oscillators) joins the board. |
| 36 | Wire for SEL_B: into A21. This is where selector switch lug 2 (all three) joins the board. |
| 37 | Wire for T1: into A8. This is where pitch 1 pot wiper (jumper the wiper to lug 1) joins the board. |
| 38 | Wire for T2: into A10. This is where pitch 2 pot wiper (jumper the wiper to lug 1) joins the board. |
| 39 | Wire for T3: into A12. This is where pitch 3 pot wiper (jumper the wiper to lug 1) joins the board. |
| 40 | Wire for GND2: into the bottom − rail. This is where level pot lug 1 and the output jack sleeve joins the board. |
Power up
| Step | Do |
|---|---|
| 41 | +9V - DC jack +, through the power switch if you fit one (9V, center-negative pedal supply): clip to the top + rail. |
| 42 | GND - DC jack -: clip to the bottom − rail. |
| 43 | Before the battery: meter on continuity. rail to rail reads open, not a short A14 to bottom − rail beeps (U1.7 to GND) A24 to bottom − rail beeps (U2.7 to GND) J9 to top − rail beeps (U1.13 to GND) J11 to top − rail beeps (U1.11 to GND) J13 to top − rail beeps (U1.9 to GND) J19 to top − rail beeps (U2.13 to GND) J20 to top − rail beeps (U2.12 to GND) J23 to top − rail beeps (U2.9 to GND) |
| 44 | Power on. |
Translated by Copper Bottom v1.7.29 from XOR_Cross_Mod.json.
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.