Hi all,
I am working on creating a simple electronic drum kit using an Arduino Due microcontroller. I currently have piezo sensors detecting a hit, and am able to have audio playback through headphones. I am storing the audio samples on an SD card, and using SPI to interface an adafruit SD shield.
After resetting the board, I can hit a sensor and play back a sound sample through the DAC loud and clear. My problem is that if I hit the sensor a second, third, fourth time etc...samples are played very distorted. I am wondering why the first sample plays so clearly, but the following samples are so unclear.
I've also noticed that after resetting the board, I hear absolutely nothing through the headphones. After hitting a sensor once, it plays, and when it is complete some static sound remains.
I've attached a text file with my code, as well as a picture of the project (nything left of the pot is an amplifier circuit that is only used for speaker playback, not the headphones).
If anybody has an experience using SD over SPI for audio playback, any insight into this issue is greatly appreciated.
Thanks,
Greg
SD_Audio_Code.txt (5.19 KB)

