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

Lo-fi Arduino Guitar Pedal
Bit crushing, rate reducing, weird noises: DIY 10-bit effects/guitar pedal with an Arduino for lo-fi DSP.

Check out the demo video on Vimeo.
 
Remove these adsRemove these ads by Signing Up
 

Step 1Materials

Materials

Tools

  • Arduino (Diecimila, or with auto-reset)
  • Soldering iron
  • Hot glue gun
  • Wire cutters
  • Drill press or dremel

Materials

  • Enclosure
  • Solder
  • Hot glue
  • Wire
  • Perf board
  • Audio jacks (I used 1/8") (x2)
  • Interface inputs, e.g.: 3 potentiometers
  • Interface outputs, e.g.: 3 LEDs and 3 150 ohm resistors
  • Resistors: 1 k, 10 k, 1.2 k (x2), 1.5 k, 390 k
  • Capacitors: 2.2 uF (x2)

Double the number of resistors and capacitors for stereo wiring.
« Previous StepDownload PDFView All StepsNext Step »
88 comments
1-40 of 88next »
Feb 21, 2012. 2:10 PMpurebluearth says:
could someone tell me why the compiler tells me that analogWrite is not defined within scope?
Mar 1, 2012. 8:09 AMstvincent says:
I'm a total arduino/electronics noob, but I think that some of the function libraries got migrated to a new location in some core revision to the arduino libraries.

Basically, in dsp.cpp, replace

#include "WProgram.h"

with

#include

And then make the same swap in timers.cpp with

#include "WConstants.h"


The code at least compiled for me. Of course I am still having problems with the actual build. All I'm getting is a very faint square wave buzz that modulates with knobc.

Why did I think this was going to be simple?
Jan 2, 2012. 2:50 PMDJsoundestroyer says:
hey man! this looks truly awesome. any chance of a video or mp3? also, how would keyboards/synthesizers/drum machines work through this? sweet project!
-stefan1138
Sep 16, 2011. 3:02 PMnexekho says:
I got the asynchronous analog read you discussed working, though not using interrupts but a standard loop. Vastly increases my sample rate. Ported the chorus/flanger to it.
code: http://pastebin.com/thP70QFj
Sep 15, 2011. 6:10 PMnexekho says:
Wrote a chorus!
Pot 1 is chorus speed. Define LINEARITY for experimental sine wave LFO using pot 2 to blend between linear or sine (it has problems) and pin 13 which has a LED on most devices will display the rate visually.
http://pastebin.com/nCNyXSsR
Works really nicely on low values, with a subtle flange on high values. Can also do many silly noises with the chorus set really fast.
Sample: http://soundcloud.com/nexekho/arduino-lo-fi-chorus
Sep 15, 2011. 6:11 PMnexekho says:
Site note: buffers take up quite a bit of memory, might need to go mono for a Mega 168.
Sep 15, 2011. 6:17 PMnexekho says:
Sounds MUCH BETTER in mono due to higher sample rate.
http://pastebin.com/2ed16VD0
http://soundcloud.com/nexekho/much-much-smoother
Sep 16, 2011. 3:44 AMnexekho says:
Added a depth control that changes how far it sweeps. Very useful for getting good flange effects.
Code: http://pastebin.com/cRmNHCdk
Sample: http://soundcloud.com/nexekho/flange-this
Sep 25, 2010. 11:05 AMLukaR says:
Is there a way to add an on/off switch to the circuit (like the one on the picture), making a stomp box out of this?
Sep 15, 2011. 1:40 PMnexekho says:
You can make a bypass with a SPDT which will select either the Arduino output or the guitar input, but it will likely "suck tone" and as such you will need a DPDT to isolate the Arduino input as well.
Aug 18, 2011. 6:39 PMBlip-Blip-Duino says:
Yes it would be possible, in tonepad.com you can see a wiring diagram for these switches. It would have to be a DPDT or 3PDT.
Mar 24, 2011. 4:40 PMzoltzerino says:
Hope this helps:
http://www.muzique.com/lab/truebypass.htm
Sep 14, 2011. 1:41 PMnexekho says:
Hey, I just built one of these on perfboard, made a mistake on the inputs (biasing with A7 rather than 5V, will correct in the morning) and while almost everything works (the dials work, etc.) I can't get a sound wave out. If I just take a standard flashing light example script and tell it to whack a PWM to pin 3, it outputs a very loud square wave. Using your code, nothing is output. This is my first Arduino project. I'm using a Nano but it's a Mega328P Nano which should work right?
Sep 14, 2011. 3:50 PMnexekho says:
I've fixed it now. It was an issue with the timer registers. Thanks for the design.

I've attached some photos of my custom build.  Small size was a priority here so I built the output filters under the Arduino itself which was a fun challenge.
Sep 15, 2011. 10:11 AMnexekho says:
Made some code changes and got it as good as it'll ever be in terms of sound cleanliness. Using 10-bit in, 16-bit out, and a prescale of 8.
Sample: http://soundcloud.com/nexekho/almost-perfect
(note: I'm using a POD as a preamp and distortion, the Arduino is just clean passthrough at the moment and then a Valvecaster post-amp before going into my PC's line in)
Code: http://pastebin.com/9zphwpvA
I'm finding that using a tone dial to roll off the highs makes a far cleaner sound.
Sep 14, 2011. 1:45 PMnexekho says:
(also note: I'm not being silly, I'm trying to output a 100Hz triangle wave using your code instead of passthroughing the input ;])
Sep 14, 2011. 1:43 PMnexekho says:
Also, the schematic describes a high-pass-filter for the output. Is that right? It feels like it should be low pass.
Aug 26, 2011. 8:32 PMOr2 says:
I'm new the the arduino scene, is Diecimila the same as Duemilanove ?
Jul 10, 2011. 1:10 PMzoltzerino says:
How crucial is the ratio between resistors R and 256R, the guy in the shop couldn't tell the difference between orange and brown so I have R = 1.5k and 256R = 190k...

Could I use my 190k and two 330R in series (R=660, 256R should equal (ish) 170R (but would be 190R)? Or is that not a close enough match?

I've checked all of my wiring and joints, guitar was on, amp was on, audio leads functional, used a chorus pedal to boost the input (you used a tuner).

Thanks in advance :-)
Feb 4, 2011. 1:54 PMyesiam says:
This looks great! I was wondering if this can be used with a synth or laptop audio. And if not, if it can be modified to do so..
Aug 29, 2010. 8:43 PMj03tv says:
Weak!
Apr 29, 2010. 4:45 PMcdousley says:
does pot value matter?

Apr 26, 2010. 6:58 AMmissingmax says:
I see you used ceramic and electrolytic caps. Which one works better? 
Also, what would be the polarity if you used the electrolytics in your schematic?
Apr 20, 2010. 4:21 PMloneguitarist says:
 Any chance you could post a picture with the other side of the perfboard circuit for the DAC? I'd like to have a go at this project but am having a little trouble with this stage.

Someone should make an audio input/output sheild for the Duemilanove with all the DAC on board for projects like this!
Apr 8, 2010. 9:33 PMjsd78 says:
I was wondering what kind of preamp is necessary. I don't own a tuner that acts as a preamp (more like a filter). Is it possible to build a preamp that's not too difficult?
Mar 11, 2010. 10:53 AMlarsby says:
Hi there,

love your work, I have one question about this though, the r1 on the in-part, what is it good for, why do you need it?
Nov 11, 2009. 7:26 PMmashedmeat says:
Hi guys, great work!

I'm trying to get the basic code working, but I can't seem to get all the PWM pins going! inputs are working fine, as far as I can tell, but only pin 3 is PWM'ing. 5/6/11 do nothing! I'm just using the basic aduino dsp code right out of the box.

When I edit setupIO() in DSP.cpp to say:

  waveformGenerationMode(11, fastPWM);
  timerPrescale(11, 1);
  analogWrite(11, 0);

11 seems to work fine. (though it's just noise, because i'm not using accurate resistors...)

I can't get 5/6 to work at all.

Any ideas?

Jan 31, 2010. 9:25 PMPatches.tgz says:
I had the same problem, I got around it by removing the "analogWrite"s from:

void setupIO() {
  // prepare left
  waveformGenerationMode(3, phaseCorrect);
  timerPrescale(3, 1);
//  analogWrite(3, 0);
 
  // prepare right
  waveformGenerationMode(5, phaseCorrect);
  timerPrescale(5, 1);
//  analogWrite(5, 0);
//  analogWrite(6, 0);
 
  // faster input
  analogReference(INTERNAL);
  analogPrescale(analogPrescale32);
}

And also fiddling around with the timer registers:

void waveformGenerationMode(int pin, int type) {
  int timer = getTimer(pin);
  int wgm = type == phaseCorrect ? B001 : B011;
  if(timer == 0) {
    TCCR0B &= ~(B1 << 3); // clear WGM02
    TCCR0A &= ~B11; // clear WGM01 and WGM00
    TCCR0A |= wgm | B11110000; // set WGM01 and WGM00, Compare on Match
  } else if(timer == 2) {
    TCCR2B &= ~(B1 << 3); // clear WGM23
    TCCR2A &= ~B11; // clear WGM21 and WGM20
    TCCR2A |= wgm | B11110000; // set WGM21 and WGM20, Compare on Match
  }
 
Feb 1, 2010. 5:13 AMmashedmeat says:
Thanks man!

I'll try that and let you know how it goes.
1-40 of 88next »

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