# Guitar Distortion With Diodes In Code, Not Hardware

Guitarists will do just about anything to get just the right sound out of their setup, including purposely introducing all manner of distortion into the signal. It seems counter-intuitive, but it works, at least when it’s done right. But what exactly is going on with the signal? And is there a way to simulate it? Of course there is, and all it takes is a little math and some Arduino code.

Now, there are a lot of different techniques for modifying the signal from an electric guitar, but perhaps the simplest is the humble diode clipping circuit. It just uses an op-amp with antiparallel diodes either in series in the feedback loop or shunting the output to ground. The diodes clip the tops and bottoms off of the sine waves, turning them into something closer to a square wave, adding those extra harmonics that really fatten the sound. It’s a simple hack that’s easy to implement in hardware, enough so that distortion pedals galore are commercially available.

In the video below, [Sebastian] explains that this distortion is also pretty easy to reproduce algorithmically. He breaks down the math behind this, which is actually pretty approachable — a step function with a linear part, a quadratic section, and a hard-clipping function. He also derives a second, natural exponent step function from the Schockley diode equation that is less computationally demanding. To implement these models, [Sebastian] chose an Arduino GIGA R1 WiFi, using an ADC to digitize the guitar signal and devoting a DAC to each of the two algorithms. Each distortion effect has its own charms; we prefer the harsher step function over the exponential algorithm, but different strokes.

Kudos to [Sebastian] for this easy-to-understand treatment of what could otherwise be a difficult subject to digest. We didn’t really expect that a guitar distortion pedal would lead down the rabbit hole to diode theory and digital signal processing, but we’re glad it did.

# Gigantic Working Arduino Uses 1/4″ Cables

What is it about larger-than-life versions of things that makes them so awesome? We’re not sure exactly, but this giant working Arduino definitely has the ‘it’ factor, whatever that may be. It’s twelve times the size of a regular Uno and has a Nano embedded in the back of it. To give you an idea of the scale, the reset button is an arcade button.

The Arduino Giga’s PCB is made of 3/4″ plywood, and the giant components represent a week and a half of 3D printing. The lettering and pin numbers are all carved on a CNC and filled in with what appears to be caulk. They didn’t get carved out deeply enough the first time around, but [byte sized] came up with a clever way to perfectly re-register the plywood so it carved in exactly the same places.

Although we love everything about this build, our favorite part has to be the way that [byte sized] made the female headers work. Each one has a 1/4″ audio jack embedded inside of it (a task which required a special 3D printed tool), so patch cables are the new jumper cables. [byte sized] put it to the test with some addressable RGB LEDs on his Christmas tree, which you can see in the build video after the break.

You can buy one of those giant working 555 timer kits, but why not just make one yourself?