This video shows an early prototype of my arduino MIDI rockband drumset.
Hey man, nice job. Can I have a gander at the source code? <br> <br>Thanks, Josh
Here you go. If it seems confusing, see my other instructable about Arduino MIDI Organ Pedals. I explain the code in that instructable. Also note that this is not the source code that was used in the video. I have since modified it to produce different sounds. I also added a second pedal that when pressed, makes the sound of a closing Hi-Hat, and when the left drum trigger is hit it makes the sound of a closed Hi-Hat being hit. Also, when the pedal is not pressed and the left trigger is hit, it makes an open hi-hat sound. I hope you find this useful! <br>----------------------------------------------------------------------------------------------------- <br>int redpad=0; <br>int yellowpad=0; <br>int bluepad=0; <br>int greenpad=0; <br>int peddle=0; <br>int lastpeddle=0; <br>int peddle2=0; <br>int lastpeddle2=0; <br> <br>int hiHat = 0; <br> <br>void setup() { <br>Serial.begin(31250); <br>pinMode(5, INPUT); <br>pinMode(6, INPUT); <br> <br>} <br> <br>void loop() { <br> <br>redpad = analogRead(A0); <br>if (redpad &gt;25) { <br>if (hiHat == 1) { <br>noteOn(0x99, 42, 0x7F); <br>noteOn(0x99, 42, 0x00); <br>} <br>else { <br>noteOn(0x99, 46, 0x7F); <br>noteOn(0x99, 46, 0x00); <br>} <br>} <br> <br> <br>yellowpad = analogRead(A1); <br>if (yellowpad &gt;25) { <br>noteOn(0x99, 40, 0x7F); <br>noteOn(0x99, 40, 0x00); <br>} <br> <br>bluepad = analogRead(A2); <br>if (bluepad &gt;25) { <br>noteOn(0x99, 47, 0x7F); <br>noteOn(0x99, 47, 0x00); <br>} <br> <br>greenpad = analogRead(A3); <br>if (greenpad &gt;25) { <br>noteOn(0x99, 57, 0x7F); <br>noteOn(0x99, 57, 0x00); <br>} <br> <br>peddle = digitalRead(6); <br>if (peddle != lastpeddle) { <br>if (peddle == 1) { <br>noteOn(0x99, 36, 0x7F); <br>} <br>else { <br>noteOn(0x99, 36, 0x00); <br>} <br>} <br> <br> <br> <br>peddle2 = digitalRead(5); <br>if (peddle2 != lastpeddle2) { <br>if (peddle2 == 1) { <br>noteOn(0x99, 44, 0x7F); <br>noteOn(0x99, 44, 0x00); <br>hiHat = 1; <br>} <br>else { <br>hiHat = 0; <br>} <br>} <br>else { <br>if (peddle2 == 1) { <br>hiHat = 1; <br>} <br>else { <br>hiHat = 0; <br>} <br>} <br> <br> <br>lastpeddle = peddle; <br>lastpeddle2 = peddle2; <br> <br>delay(50); <br>} <br> <br>void noteOn(byte cmd, byte data1, byte data2) { <br>Serial.write(cmd); <br>Serial.write(data1); <br>Serial.write(data2); <br>}
College has been keeping me pretty busy, so this project has gradually come to a halt. I can post the source code as another comment if anyone asks.<br> Here are the links to the parts I purchased:<br> <br> For use with an Arduino Duemilanove:<br> http://www.cutedigi.com/arduino/atmega328-with-arduino-bootloader-duemilanove-bootloader.html<br> -OR-<br> For use with an Arduino Uno:<br> http://www.cutedigi.com/arduino/atmega328-with-arduino-bootloader-uno-bootloader.html<br> <br> DIP Socket for atmega328p:<br> http://www.cutedigi.com/arduino/atmega328p-dip-socket-for-arduino.html<br> <br> 16 MHz Crystal:<br> http://www.cutedigi.com/arduino/crystal-16mhz.html<br> <br> Power Regulator:<br> http://www.cutedigi.com/arduino/wall-adapter-barrel-to-5v-and-3-3v-breadboard-supply.html<br> <br> 22 pF Capacitor (x2):<br> http://www.cutedigi.com/component/capacitor/capacitor-ceramic-22pf.html<br> <br> Perf Board to solder it all to:<br> http://www.radioshack.com/product/index.jsp?productId=2103798<br> <br> MIDI cable:<br> http://www.musiciansfriend.com/accessories/hosa-midi-cable<br> <br> And of course, a rockband drumset (it shouldn't matter if it's xbox 360, wii, playstation 2 or 3):<br> http://www.ebay.com/sch/i.html?_from=R40&amp;_sacat=0&amp;_nkw=rock%20band%20drum%20set&amp;_fscr=1<br> <br> I can't remember what resistors I used to pull down the analog inputs for the drum triggers.&nbsp; I'm sure they're interchangeable, and in hindsight, potentiometers would probably would have been a good idea to adjust the sensitivity of the triggers.&nbsp;<br> <br> Since this video, I added support for a second foot pedal and reprogrammed the chip to output different midi notes to utilize a hihat sound.&nbsp; The second pedal decides whether the hihat makes a closed or open sound.<br> <br> This entire project cost me around $50.&nbsp; I don't have a schematic, but the wiring is pretty self explanatory.<br> <br> The most important parts of this project are modified from the following tutorial:<br> http://arduino.cc/en/Tutorial/Midi<br> <br> If anyone improves or expands on this project, keep me in the loop.&nbsp; I'd like to see what others can do and learn from them.<br> <br> -Royce
post me bill of material, if possible. <br>
Nice...keep up the good work :)

About This Instructable




Bio: I'm an Electrical Engineer working out of Northern California with a never ending interest in repairing and creating.
More by roycetaft:Homemade GameCube Mod-Chip Arduino MIDI Foot Pedal Keyboard Arduino MIDI Rockband Drumset 
Add instructable to: