3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Lo-fi Arduino Guitar Pedal

Step 6Upload DSP Code

Upload DSP Code
Download the code and you'll find two folders. One is the basic DSP code, "ArduinoDSP", that you can use to make your own pedal. "GlitchPedal" is the one I used for this specific setup. At some point, Vimeo removed the per-group file hosting I was using to host the code. For better reference, see this code from Tony Ivanov or follow Randy's Instructable instead.

ArduinoDSP


The includes in ArduinoDSP are useful for setting the proper PWM prescaling and analog input prescaling values. They turn pins 3 and 11 into the left outputs (8 and 2 bits respectively) and 5 and 6 into the right outputs, using Fast PWM settings with no prescaling so the PWM is as fast as possible. The ADC is also set to a low prescale value, 32, and the analog reference is set to 1.1 V (the internal reference).

To modify the basic ArduinoDSP code, just insert your own code to modify the variable "input" between the line "short input = analogRead(left);" and "output(left, input);".

GlitchPedal


The code I've already written does a few things. The LEDs provide visual feedback about the knob positions and input level, and the pots control settings for the DSP happening inside the microcontroller. The first pot controls the mode, the second controls a parameter of that mode, and the third controls an effective sample rate. The modes include:

  • Bitcrush: bit shift the input to the right and then to the left, chopping off N bits.
  • Bitshift : shift the input to the left, leading to a weird effect for the first few values and then eventually noise (i.e., the "dithering bits").
  • Overdrive: Multiply the input by a float from 1-20.
  • Binary impulse response: do various binary operations on the input and the last result (XOR, NOR, XNOR, NAND...)
« Previous StepDownload PDFView All StepsNext Step »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
111
Followers
6
Author:kylemcdonald