MBED_Guitar_Pedal
This is basically a way to create a "generic" guitar pedal. By that, I mean that this is a great way to get a guitar signal into your mbed at the correct voltage, and then get the signal back out to send it through an amp. I've included code to generate an echo/delay effect, but the code can be changed to generate any number of effects.
Code
simple code
#include "mbed.h"
#define BUFFER_MAX 15000
#define BUFFER_MIN 50
AnalogIn fromGuitar(p19);
AnalogOut toAmp(p18);
AnalogIn buffer_size(p15);
unsigned short buffer[BUFFER_MAX];
int inv_gain = 3;
int delay = BUFFER_MAX;
void getValues(void) {
delay = buffer_size*BUFFER_MAX;
if (delay < BUFFER_MIN)
delay = BUFFER_MIN;
}
int main() {
int i;
for (i = 0; i < delay; i++)
buffer[i] += fromGuitar.read_u16();
for (i = 0; ; ) {
buffer[i] = buffer[i]/inv_gain + fromGuitar.read_u16();
toAmp.write_u16(buffer[i]);
i = (i+1) % delay;
if (i == 0)
getValues();
}
}
Circuit Diagram
- R1,R7, R8
- 2.2k
- R2,R4
- 100k
- R3
- 47k
- R5, R6
- 4.7k
- R10, R11
- 10k
- C1
- 47uF
- C2
- 2.2nF
- C3
- 4.7nF
- C4
- 470uF
- C5, C6
- 0.1uF
Comments
As stated before, this should be used as a guide to connect a guitar and amp to the mbed controller. Use this to create a skeleton guitar pedal that you can program to whatever effect you desire.
2 comments on MBED_Guitar_Pedal:
Please log in to post comments.

Hello Wes,
nice project to go on with. What op-amps are you using and are they especially designed for audio (is there such a thing?) or are they just run of the mill op-amps?. I notice that the non-inverting input of U5 is not connected to anything, is this normal?
Cheers
Mike