Check out the demo video on Vimeo.
Remove these ads by
Signing UpStep 1Materials
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)
| « Previous Step | Download PDFView All Steps | Next Step » |














































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?
-stefan1138
code: http://pastebin.com/thP70QFj
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
http://pastebin.com/2ed16VD0
http://soundcloud.com/nexekho/much-much-smoother
Code: http://pastebin.com/cRmNHCdk
Sample: http://soundcloud.com/nexekho/flange-this
http://www.muzique.com/lab/truebypass.htm
On the other hand, if it is a momentary switch you'll need to wire it to an interrupt pin on the Arduino and modify the code to watch for that interrupt, not applying any effects when the toggle is on.
I'm sure there are also plenty of schematics out there for making toggle boxes with these switches, in which case you would just wire your clean signal to one input and the distorted signal to the other.
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.
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.
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 :-)
Also, what would be the polarity if you used the electrolytics in your schematic?
I vaguely remember, on the outputs, the electrolytic caps facing the output. But again, you should try it both ways -- this was two years ago now and I have been writing a lot more code that making circuits since then :)
Someone should make an audio input/output sheild for the Duemilanove with all the DAC on board for projects like this!
If I remember correctly, the perf board wasn't connected on the back and everything was manually soldered. So hopefully the diagrams/schematics on this page will explain anything missing from the pictures. The pictures were meant more as a layout guide for fitting the components in a smaller space.
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?
The r1 acts to "scale" the incoming signal. I generally think in terms of software rather than hardware, so you can imagine the chain on the input acting like this:
- r1 divides the signal (scales it down slightly)
- c1 centers the signal around zero (removes the DC component)
- r2 and r3 add a constant DC component back in -- shifting the signal up
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?
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
}
I'll try that and let you know how it goes.