I have had this Arduino due for a while and have wanted to make a music project out of it. It has been hard to find any really good examples of using this thing for audio. I finally found these few sites that have helped me speed up the ADC conversions so they are good for audio.
http://forum.arduino.cc/index.php?topic=156849.0
http://www.djerickson.com/arduino/
So from those two posts I was able to build these two projects and I'm overall impressed with the results:
Simple Audio Delay with Feedback
Note that the ADC's only track ~0-3V and most audio signals go negative (example: -1V to 1V). You will mostly likely need to add a DC offset to your input to avoid clipping the signal. (cutting off the lower half of the waveform). You can do this in many of different ways. I happen to have some modular synth gear and one module in particular is the MATHS by Make Noise. I use this to amplify and offset the input signal. In a later post I might build a circuit to perform the DC offset. They are very simple but right now I want to just do some simple tests without spending too much time if it sounds terrible. For now here is an image of a DC offset amplifier:
Here is the code to create a very simple audio delay with feedback using the Arduino Due. Not all of this code will run on other Arduino's as they might be to slow or not have enough memory and setting of the ADC registers is specific to this version.
Here is an example of what it sounds like. Not bad but there is a lot of room for improvement. The noise is the first issue that needs to be addressed. I found that this comes from the delay line and I will most likely need to add some type of filter to overcome this.
If you take the loop function above and change it to just the following code then this will simply pass the signal through without modification. Notice that the signal output is much cleaner.
In my next post I will try to clean this up. But for right now this at least gets me started.
No comments:
Post a Comment