Introduction: Arduino MIDI Rockband Drumset

This video shows an early prototype of my arduino MIDI rockband drumset.

Comments

author
jlane21 (author)2013-06-04

Hey man, nice job. Can I have a gander at the source code?

Thanks, Josh

author
roycetaft (author)jlane212013-06-04

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!
-----------------------------------------------------------------------------------------------------
int redpad=0;
int yellowpad=0;
int bluepad=0;
int greenpad=0;
int peddle=0;
int lastpeddle=0;
int peddle2=0;
int lastpeddle2=0;

int hiHat = 0;

void setup() {
Serial.begin(31250);
pinMode(5, INPUT);
pinMode(6, INPUT);

}

void loop() {

redpad = analogRead(A0);
if (redpad >25) {
if (hiHat == 1) {
noteOn(0x99, 42, 0x7F);
noteOn(0x99, 42, 0x00);
}
else {
noteOn(0x99, 46, 0x7F);
noteOn(0x99, 46, 0x00);
}
}


yellowpad = analogRead(A1);
if (yellowpad >25) {
noteOn(0x99, 40, 0x7F);
noteOn(0x99, 40, 0x00);
}

bluepad = analogRead(A2);
if (bluepad >25) {
noteOn(0x99, 47, 0x7F);
noteOn(0x99, 47, 0x00);
}

greenpad = analogRead(A3);
if (greenpad >25) {
noteOn(0x99, 57, 0x7F);
noteOn(0x99, 57, 0x00);
}

peddle = digitalRead(6);
if (peddle != lastpeddle) {
if (peddle == 1) {
noteOn(0x99, 36, 0x7F);
}
else {
noteOn(0x99, 36, 0x00);
}
}



peddle2 = digitalRead(5);
if (peddle2 != lastpeddle2) {
if (peddle2 == 1) {
noteOn(0x99, 44, 0x7F);
noteOn(0x99, 44, 0x00);
hiHat = 1;
}
else {
hiHat = 0;
}
}
else {
if (peddle2 == 1) {
hiHat = 1;
}
else {
hiHat = 0;
}
}


lastpeddle = peddle;
lastpeddle2 = peddle2;

delay(50);
}

void noteOn(byte cmd, byte data1, byte data2) {
Serial.write(cmd);
Serial.write(data1);
Serial.write(data2);
}

author
roycetaft (author)2013-03-18

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.
Here are the links to the parts I purchased:

For use with an Arduino Duemilanove:
http://www.cutedigi.com/arduino/atmega328-with-arduino-bootloader-duemilanove-bootloader.html
-OR-
For use with an Arduino Uno:
http://www.cutedigi.com/arduino/atmega328-with-arduino-bootloader-uno-bootloader.html

DIP Socket for atmega328p:
http://www.cutedigi.com/arduino/atmega328p-dip-socket-for-arduino.html

16 MHz Crystal:
http://www.cutedigi.com/arduino/crystal-16mhz.html

Power Regulator:
http://www.cutedigi.com/arduino/wall-adapter-barrel-to-5v-and-3-3v-breadboard-supply.html

22 pF Capacitor (x2):
http://www.cutedigi.com/component/capacitor/capacitor-ceramic-22pf.html

Perf Board to solder it all to:
http://www.radioshack.com/product/index.jsp?productId=2103798

MIDI cable:
http://www.musiciansfriend.com/accessories/hosa-midi-cable

And of course, a rockband drumset (it shouldn't matter if it's xbox 360, wii, playstation 2 or 3):
http://www.ebay.com/sch/i.html?_from=R40&_sacat=0&_nkw=rock%20band%20drum%20set&_fscr=1

I can't remember what resistors I used to pull down the analog inputs for the drum triggers.  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. 

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.  The second pedal decides whether the hihat makes a closed or open sound.

This entire project cost me around $50.  I don't have a schematic, but the wiring is pretty self explanatory.

The most important parts of this project are modified from the following tutorial:
http://arduino.cc/en/Tutorial/Midi

If anyone improves or expands on this project, keep me in the loop.  I'd like to see what others can do and learn from them.

-Royce

author
Sanjay Limbore (author)2013-03-17

post me bill of material, if possible.

author
akinich (author)2012-06-03

Nice...keep up the good work :)

About This Instructable

5,170views

20favorites

License:

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-ChipArduino MIDI Foot Pedal KeyboardArduino MIDI Rockband Drumset
Add instructable to: