For several years, [Ray] and [Anna], the team behind ElectroSmash, have been smashing audio electronics and churning out some sweet DIY audio gear. This time around, they’ve built Pedal-Pi — a simple programmable guitar pedal based around the Raspberry-Pi Zero. It is aimed at hackers, programmers and musicians who want to experiment with sounds and learn about digital audio. A lot of effort has gone in to documenting the whole project. Circuit analysis, a detailed BoM, programming, assembly and background information on related topics are all covered on their Forum.
The hardware is split in to three parts. On the input, a MCP6002 rail-to-rail op-amp amplifies and filters the analog waveform and then a MCP3202 ADC digitizes it to a 12-bit signal. The Pi-Zero then does all of the DSP, creating effects such as distortion, fuzz, delay, echo and tremolo among others. The Pi-Zero generates a dual PWM signal, which is combined and filtered before being presented at the output. The design is all through hole and the handy assembly guide can be useful for novices during assembly. The code examples include a large number of pedal effects, and if you are familiar with C, then there’s enough information available to help you write your own effects.
Even if you don’t plan on building one, technical background such as the Basics of Audio DSP in C for Raspberry Pi Zero, Using MCP3202 ADC with Raspberry Pi Zero and PWM Audio on Raspberry Pi Zero ought to make for interesting reading. Check out the video after the break detailing the build.
If you’d like to check out some of their earlier work, check out 1WAMP, an Open Hardware Guitar Amplifier and pedalSHIELD, an opensource Arduino Guitar Pedal.
26 thoughts on “Pedal-Pi, Simple Programmable Guitar Pedal”
If you’re just looking for the software, its posted here https://www.electrosmash.com/forum/pedal-pi/202-how-to-start-programming-pedal-pi?lang=en and contained in a file called “Pedal-Pi-All-Effects.zip”.
does it support any standard audio interface/server so we can use existing dsp software ? Seems like they’re using the bcm2835 api to output sound ..
The standard bcm2835 are used to read the guitar and generate the output, so you have access to the raw data to to your own dsp.
The aim was to learn how to build functional harware from easy-to-find throughole parts, and in the software side to generate effects ( distortion, fuzz, delay, echo, etc) understanding how they work.
So it does not support dsp pluggings, we did not work in that direction yet ;)
well write some device drivers and there’s a whole host of existing OSS audio effects software and even guitar effects software that becomes available. You could probably clone and edit some I2S kernel modules to get it working quickly, also i’d get rid of the dual PWM output and just go for any old I2S DAC.
Well it’s functionally versatile but part of me is nagging about a full Linux OS on a 1GHz CPU for *audio*
I made something similar https://www.youtube.com/watch?v=adsEnV4qAwk with a 50Mhz PIC is that slow enough? :o)
That’s an awesome project. Well done.
Very nice! I also like that you used a pic instead of an entire raspi. An os booting computer is really overkill for such a project. I wonder how long the pi takes to boot to a usable pedal. Yours seems instant. Great job!
I think the other is flexibility and easier to change/program. You could try the teensy dsp/audio functionality for a “simpler” setup: https://www.pjrc.com/teensy/td_libs_Audio.html
Without looking into the details, the “shield, hat, cape, or whatever is the damn trend word today” looks pretty much what they have already done for arduino uno.
This is a job for a $2 Blue pill
indeed ! with a PT8211 50ct. stereo DAC
Yep, I’ve seen powerful synths, DSPs and even MOD players running on low end 32-bit microcontrollers.
how does it handle startup / shutdown and SD corruption if its running raspbian?
Well, the software integrity relies on the raspbian OS, so far we did not have any issue.
Neat project! In a similar vein, Qu-Bit did a Eurorack synth module based on a full-sized Pi, called the Nebulae (it’s now discontinued though). http://www.qubitelectronix.com/legacymodules
If you’re just unplugging the Pi without doing a shutdown command prior, you’re begging for trouble (i.e. the SD card corruption mentioned above). I would suggest implementing some kind of three finger salute — e.g. pressing all three switches for two seconds issues a shutdown command to Raspbian.
I’ve done this on BeagleBone Black 2 years ago https://github.com/dumpram/BeagleBlack_GuitarProcessor
Thats cool, I am finishing college and I am interested in digital audio, I will try to understand the codes and see if I can build one with some spare parts I have around
Yes, the basic idea was to do something similar to the arduino pedalSHIELD projects we did before, with some changes in the hardware (spi adc) and new codes (using bcm2835 libraries).
With Raspberry you can benefit from (virtually) unlimited memory and super high speed processing, cheap boards.. . If you are into software development there are plenty of options: rtos, baremetal, etc.
The thing about these pedal projects is you get plenty of dead-simple code examples like echo, reverb, distortion, but no one’s sharing stuff like a good resonant lowpass filter which sounds musical and behaves at all possible settings and inputs. The PJRC.com teensy audio library (which is excellent, thanks Paul!) is a good example of this. The included lowpass implementation misbehaves at minimum resonance and minimum cutoff, breaking into what sounds like chaos (nasty loud white noise). It also is incapable of self-oscillation.
Sounds good, great job. But it’s a bit standard. I was expecting something special that other devices can’t do. Like a delay with a pitch or something.
Why not use a DAC and go full 24bits, which is mandatory today for a decent effect, PWM audio is for toys.
Have they measured the latency?
Raspberry Pi is able to read the ADC using the SPI bus as a sample rate at least 40KHz, that is around 25uS, then you have the DSP which is extremely fast (the Pi Zero is a beast) – lets say another 10uS – and then you have to write back into PWM that has a refresh rate is 150KHz region (6us). At the end of the day you will have 25 + 10 + 6 = 50uS approx. which is below the ms region and not noticeable unless you pay extreme attention.
that is not latency, that’s just the sample times, latency is caused mainly by buffers. and buffer size might be dictated by the dsp algorithm used.
Please be kind and respectful to help make the comments section excellent. (Comment Policy)