Playing With DSP And Building A Guitar Pedal

Building guitar pedals has come a long way from hooking up a few transistors and building a simple boost circuit. [Cloudscapes] has been working on a Anti-nautilus auto glitch, auto repeat pedal, and if you’re looking for something that sounds like a spaghetti western soundtrack skipping on a record player, we couldn’t think of anything better.

[Cloudscapes] was already familiar with 8-bit AVRs, but when doing real-time audio sampling, a more powerful microcontroller was in order. He turned to the MikroElektronika MINI-32 board for development purposes. This small board fits a PIC32 microcontroller into an easily breadboardable DIP-40 form factor, perfect for playing around with some very capable hardware.

For the DAC, [Cloudscapes] had some experience with the 16-bit PT8211, but finding a good 16-bit ADC in a convenient package was a bit of a challenge. He eventually settled on the 12-bit MCP3201 ADC, more than enough for a pedal that is supposed to sound lo-fi.

After [Cloudscapes] got a few boards made, he started on his DSP adventure. Unfortunately, the initial code used unsigned 16-bit words to represent each sample, meaning every time the loop repeated it would start at 0 and produce a short pop in the speaker. After a week of debugging, [Cloudscapes] realized signed integers are a much better data format for storing audio data and got rid of the problems plaguing his project.

Now [Cloudscapes] has a wonderful DSP dev board, perfect for making new and strange guitar effects. After the break you can listen to a demo of what the Anti-nautilus pedal actually does, and we’ve got to say it sounds great.

Thanks [Chris] for sending this one in.

[youtube=http://www.youtube.com/watch?v=JdqwXGB0944&w=470]

19 thoughts on “Playing With DSP And Building A Guitar Pedal

    1. There are two kinds of popping. The popping talked-about in the post-mortem only occured at loop-points when I was fading the samples (which was almost never in the video). The other “popping” which is more of a crackle, is the micro slicing that occurs every time the pedal truncates ppieces of sound. At the moment it’s unavoidable. I’m no DSP ninja. Besides, I don’t think the crackling sounds bad. It makes the sound broken, which is kind of the point. The loop-point popping def had to go though, because it occured even when you weren’t slicing/breaking sound up, and just used it as a weird sampler.

  1. Using MikroElectronika’s PIC32 board, why not also use their audio CODEC board as well (single-chip ADC/DAC 24-bit resolution)?
    http://www.mikroe.com/add-on-boards/audio-voice/audio-codec-proto/

    The CODEC chip is very similar to what’s used in the iPhone, and Microchip also has some example code that should work (if you want to use MPLABX instead of MikroE’s tools):
    http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en554942

    1. Mainly because I’m still a beginner and the frame-mode SPI and exotic clock stuff that involves codecs still make my head spin a bit. As for DACs and ADCs, I’d been using those for years so I had those up and running in minutes.
      I did order that board however, and I’ll be trying it out. See if I can get it pass sound. I don’t expect that to be very quick though. When it comes to teaching and being tought, I’m very much a simple-words layperson, and codec datasheets (which I have studied) are anything but.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.