What would I need to build a bitcrusher?

Alright guys, a bit of background. I'm an electronic musician and have just recently got into the Arduino game. My first and most recent project has been a MIDI output device that triggers drums (in Reason) from piezo sensors. Now I have delusions of grandeur and began planning my next project:

I want to make a bitcrusher pedal. That is, a pedal (sometimes called a stompbox) that will take input from a condenser microphone, guitar, etc., convert it to digital, truncate a selected amount of bits, and output the result as audio. I'll have some extra elements to make it more than boring old ADA conversion (including tube amplification), but I want to make sure I've got all my bases covered before I even begin thinking about building it. Here's what I think I need:

A/D converter (16 bit) -> Microcontroller (Arduino) -> (D/A converter)

I've got two problems. First, the Arduino only has 4-bit A/D conversion. For audio input, we're gonna need more than that. So I'll be outsourcing A/D conversion to something like this: http://focus.ti.com/lit/ds/symlink/pcm2705.pdf

Second, is it possible for the Arduino to receive data that fast (48kHz), process it, and spit it right back out? Further more, do I NEED the D/A converter, or can the Arduino use PWM to output the result? I know I can program the rest, but the actual digital input/output is where I need guidance. Thanks guys.

I've got two problems. First, the Arduino only has 4-bit A/D conversion.

Actually, the Arduino has 10bit A/D conversion.

Try to check this instructables project, i yhink that it is very similar to what you want to achieve:

http://www.instructables.com/id/Lo_fi_Arduino_Guitar_Pedal/

Actually, the Arduino has 10bit A/D conversion.

Yeah, I realized this after I said it. Somehow 4 digits = 4 bits in my head. Been staring a binary too long. dumbassMode=1.

Try to check this instructables project, i yhink that it is very similar to what you want to achieve:

http://www.instructables.com/id/Lo_fi_Arduino_Guitar_Pedal/

Almost! I suppose I could use it for prototyping. My two problems with this are obviously the lower processing bitrate, (10-bit sound is not the best) but what about the output bitrate? Is there anyway to tell, since the output appears analog once we use PWM?

The output bitrate is 8 bit at best.

Arduinos PWM is 8 bit.

You really can't improve that without a dedicated DAC.

But just remember that your poor little Arduino doesent have much horsepower.

reading the analog in at a decent rate, treating the input and feeding a DAC at a decent rate is going to be problematic.

Next problem is memory, unless you make it "real time" you would need to buffer the sound, and Arduino has very limited RAM.

And then again, i thought taht the general idea of a bitcrusher was to get LOFI sound :slight_smile:

And then again, i thought taht the general idea of a bitcrusher was to get LOFI sound

I didn't quite elaborate enough. :wink: One of my primary features is going to be using an external variable resistor to modulate the amount of bits being read. I.e., sweepable effects. I don't want a huge decrease in sound quality the moment I turn the thing on.

It ideally would be in realtime. Looks like the guy on the instructable did it well enough, even incorporating the 3 pots.

I think my plan of action for now is this:

1.) Get some experience by building the Lo-Fi pedal in the Instructable
2.) Add the tube amplification
3.) Add ADC, look into using a different microcontroller, DAC, etc.

That sounds as a good plan. Starting simple and moving on is almost always a clever aproach.

What you are talking about is DSP (digital signal processing), you need more memory than this little baby has and probably a lot more processing power.
To see what can be done with a small buffer see:-
http://interface.khm.de/index.php/labor/experimente/arduino-realtime-audio-processing/