Main Menu

Secondary Menu

Randomized Arduino Drum Machine

Introduction: Randomized Arduino Drum Machine

I like drum machines. However they are not always the easiest to build. I wanted one that is:

A. Simple, Yet Powerful-If it uses lots of components then it is too complicated
B. Sound-It's not a a drum machine if it "beeps"
C. Easily Modifiable-If I can't change stuff for improvement it is kind of annoying.

A meticulous internet search wasn't so successful.

Finally, I found this but, even that was a bit un-editable although it was cool. I thought that the samples were a bit small and I for one was not going to rewrite a bunch of samples.

Therefore, I decided to play around with the code and rewrote my own version of it and tweaked it around until I got a sound I liked.

Remember: Make sure you have the Potentiometer on Analog Pin 1 and not Analog Pin Zero. The True Random library uses this wobbly voltage to pick random numbers! MAKE SURE TO FREE UP ANALOG PIN 0!

I drew up a schematic from the code and then made it real.

I know this uses the TX (Digital Pin 1) and RX (Digital Pin Zero) but I had already built a Digital to Analog Converter shield for those pins and was too lazy too build it again.

Step 2: Program.

Attachments

Step 3: Okay...So What Exactly Is a DAC?

A DAC or, Digital to Analog Converter is essentially, a device that takes a series of on-off pulses from a computer, which speaks in binary (or microcontroller) and then converts it into specific voltage levels.

So How does it do it exactly?

Collin Cunningham will explain in more depth:

Step 4: Let's Get Started!

Build according to the schematic. I can supply pictures of my build in the end but my camera was broken at the time I made this and so, I don't have the pictures for during the build. Sorry.

Step 5: Let's Finish!

Solder the headers terminal and the output wires and commence testing. (make sure you screw in the potentiometer.)

Step 6: Done!

That's it!

If you need any help or you have any suggestions PM me or leave a comment below.

Epilog Challenge 9

Sew Warm Contest 2018

Gluten Free Challenge

Tips

Questions

13 Comments

sir I am building this but unfortunately in your finished pic I can see another board in between ,now I am totally confused.where to do what.i have ardiuno board and drum kit board ,do I need anything more? Please email me or leave comment My email is sagar.ndl@gmail.com

Hi bro...! I'm new to Arduino!! Currently using uno...Im.doin a project on Arduino drums! I successfully built a midi drums..now try to upgrade to e drum..I fetched the audio samples into the Arduino Uno.. Used piezo sensor as input ..getting output thr 11

PCM library(https://github.com/damellis/PCM/zipball/master)

When I hit one piezo i can able to hear the sound..but when I hit two piezo simultaneously..(.I.e kick and hats at same time )o I can't able to hear the both sound same time...struggling alot n this issue.I googled ,but n't able to find a solution...plz help me to fix the problem...

Like I said in my previous response, the problem is that the Arduino sequentially loops through the program waiting for a piezo hit, and when it detects one, it breaks the loop to play the sound that was hit. In that case, the Arduino is no longer checking for other hits, which is why two sounds can't be played simultaneously. I put some possible solutions in the reply to your last comment.

Hello, doing two things at the same time on any processor is usually a problem, especially on microcontrollers like the Arduino. While I can't diagnose the exact problem without seeing the actual source code, I would imagine that the problem is that the Arduino sequentially loops through the program waiting for a piezo hit, and when it detects one, it breaks the loop to play the sound that was hit. In that case, the Arduino is no longer checking for other hits, which is why two sounds can't be played simultaneously. There are a few ways to fix this problem: although inefficient, a hardware solution would be to make each sound its own Arduino; a different solution would be to fiddle with the code to see if it can also check for double piezo hits. While I can help with the problem, I currently have limited access to a computer (on vacation for the next two weeks), so it might take a while before I can look in depth into any programming heavy problems.