Cardboard MIDI Drum Pad
My sister and I were talking a bit ago and she said she wanted a drum. The problem is she's in college! Roommates are not going to appreciate that.
I looked for options online, but found nothing. All sorts of MIDI pads existed, but only a few had velocity sensitive drum pads and none of those were easy to follow. This is an attempt to recreate the path I followed to make it with my older brother. My brother wrote the code to add to an existing Arduino MIDI library so it would include velocity sensitive drum pads.
Supplies
Cardboard - 4 sheets at least the size of your pad
Arduino- Preferably Leonardo, Micro, or Due, which don't need extra software, but Uno and others work.
Piezo disc - 1 per drum pad
Diode - 5v Zener is best by far, but most any will work.
Resistor - 100 kΩ to 1 MΩ
Jumper wire
String - to suspend the pad
Glue - School glue and spray glue
Optional:
Buttons - For digital MIDI modifiers or playing notes
Breadboard
Tools:
Razor blade or Dremel with a drywall bit
Marker or pencil
Protractor
Draw Layout
Draw the layout you choose on the side of a cardboard box. If you want to use the same layout as I did, you can follow these measurements.
Start by deciding where you want the Arduino. Our layout put the Arduino awkwardly far from the breadboard, however putting the breadboard up top would have put the buttons awkwardly far forward. I will be updating this instructable later with an improved design.
Large Circle:
Outer Diameter (OD) - 6"
Inner Diameter (ID) - 5 1/2"
Center distance from side - 4"
Center distance from bottom - 4"
Small Circle:
Outer Diameter - 3 1/2"
Inner Diameter - 4"
Outer two:
Distance from side - 3 1/2"
Distance from top - 2 3/4"
Middle two:
Distance from side - 8 1/2"
Distance from top - 4"
Trace the Arduino between the two middle pads
Trace the breadboard on the bottom.
Cut Pads
Cut out your first layer outline and trace it on the other sheets. Cut out the other layer outlines. You should have 5 shaped sheets of cardboard. Now that you have an outline, go ahead and set 2 aside for later. You can follow 1 of 3 options to cut out the pads on the pad layer:
1) Cut out the first layer and trace the circles on each layer. Mark the inner diameter of each pad and cut the edges off to make a second layer for each pad.
2) Mark only the first layer of each pad and put a pin through the center of each circle. That will give you a place to put the protractor and mark the other layers.
3) Clamp, hold, or tape the pad layers together and cut through all layers with a dremel. If you look ahead, you can see which layers are glued together, but I haven't done this, so I can't promise it works. Just don't glue all the layers together! You'll need the top layer separate so you can run wires underneath it.
Cut Out Arduino and Breadboard Spaces
Trace the Arduino and breadboard on the top layer from last step. They should fit without a lot of wiggle room. If you want to use MIDI modifiers and buttons, put the breadboard somewhere comfortable, in my case the front center. I recommend putting it next to the breadboard rather than at the end like I did. You can route the USB cable between two pieces of cardboard in the place I put the wires.
Glue Bottom Half
Get your spray glue ready! Find somewhere well ventilated and lay down your bottom layer. Prepare your second and third layers nearby. Spray the top of the bottom and bottom of the top, wait a few seconds to a minute, and press the two layers together. Spray the top surface of that and the bottom surface of your second layer and do the same. Immediately place some kind of weight on it. I don't recommend books you don't want covered in glue!
Cut Wire Paths
Once the previous layer has dried, plan wire paths for the pad wires. Each wire path has to reach from the pad hole to the breadboard or Arduino. If you cut along the grain of the cardboard, you can make small wire paths that the wires fit into quite nicely.
Make Piezo Circuit
Probably best to solder away from a sheet of cardboard, so we're doing this before putting the pad in it's place.
Take your resistor and bend the ends down. Solder the ends of the diode to the resistor. Solder the piezo ground (large metal bottom) to the side of the diode with the line (cathode). Solder positive to the side farthest from the line (anode). In the image, red is the piezo's positive, yellow is negative.
Explanation: The diode sits backwards in the circuit because when you hit the piezo, it pushes current back and forth rapidly. Backwards current can damage the Arduino, so the diode makes an easier path for backwards current. A 5v zener diode can take forward voltage above 5v as well, making it even safer.
Put Pads Together
Each pad is made of two layers: the surface layer (which you hit) and the bottom layer (which mostly serves to hold the piezo discs in place).
Mark the center of the cardboard disc and cut a slit along the grain from the center to the edge of the disc. Lay the piezo in the center of the disc (no glue!) and put the wires in the slit. Glue the around the piezo, (but not on it unless it's superglue) so the cardboard halves stick together with the wire coming out the side.
Explanation: Most glues are soft enough that they pad the piezo and take the vibration away, making soft hits very difficult to sense. Superglue is hard enough that it improves vibration conduction, but if you mess up, there's no recovery!
Make Pad Nets
For lack of a better name, I'm calling these pad nets. These are key to making separate drum pads. If you stuck the piezo discs all on the same sheet of cardboard, every hit would trigger every pad!
Put pins around the edge of each hole and wrap string around them, keeping as much tension as possible. I added a rubber band for tension, as you can see in the photo. I recommend not using superglue here. It took large amount to get it to stick and became fragile. Elmer's glue was perfect for this part, but we didn't realize it until later pads. Once it dries, remove the pins.
Combine Layers
Now that you have your pads and nets made, get ready for the next spray glue layer. Place the pads upside down on their nets and cover the exposed wires with tape or paper. Place your top layer upside down and spray both surfaces well. If you want to use another glue to bind the pads to their nets, like lightly foaming gorilla glue, this is the time!
Flip your pads right side up so they seal to the nets. Place the surface layer on your pad body and immediately place something to weigh it down while the glue dries. Place something on each pad, such as a glass of water, so it binds well to the net.
Wiring
Getting close!
Okay, now that we have our piezo circuits from a few steps back (done early to to avoid risk of fire) our wiring is really simple.
Repeat the following steps for each drum pad and take note of which pin you attach it to, perhaps with a sticky note.
1) Connect the Arduino ground pin to the ground line of the breadboard and the 3.3v or 5v pin to the positive line.
2) Place each piezo circuit in the breadboard with the negative side on the negative line and the positive side on the breadboard.
3) Connect a jumper from the positive side of the piezo circuit to an Analog pin of the Arduino (A0, A1, etc).
BUTTONS
For each button, wire one side to ground and the other to a digital pin. I used 6 buttons connected to pins 8 through 13. See the image for an idea. Unfortunately, I didn't have enough black wires to make it look nice, and resistors would probably be better, but this is what I had on hand.
Clone ControlSurface Github
My older brother updated the ControlSurface library to include some velocity sensitive (basically how hard you hit it matters) piezo sensors or "piezo notes" in ControlSurface language.
1) Go to https://github.com/aamott/Control-Surface and click "Code" then "Download ZIP" to get a copy of the library. See the first photo.
2) Open the Arduino IDE. In the top menu, click Sketch > Include Library > Add .ZIP Library and navigate to the place you put the file you downloaded, probably the Downloads folder.
Code
My code below is a starting point, but feel free to expand! See https://tttapa.github.io/Control-Surface-doc/Doxygen/d5/d7d/md_pages_Getting-Started.html for help expanding your code beyond what I have here. You can add control change buttons (CCButtons or CCPotentiometers), note buttons (like a piano) additional drum pads, or other control elements.
To see which channels do what, you can see the Wikipedia article on General MIDI. It includes which percussion instruments are available on channel 10 (see the Percussion section) and which control change (CC) elements are available by default. I will try to keep this updated as I learn.
My code is as follows, but you can modify it as you add parts. Copy and paste the following into the Arduino IDE and replace the pin numbers with the pins you noted on your pads in the wiring step. Replace button pin numbers with your own as well or use the same as me. The comments should explain it further, but if you have questions, feel free to comment.
#include <Control_Surface.h> // Include the Control Surface library // Instantiate a MIDI over USB interface. HairlessMIDI_Interface midi; /*********** Hardware Assignments ***********/ using namespace MIDI_Notes; // Piano Note - Take note that one way to choose a note is to use the note() object // Wire a button to pin 13, the first number in the code NoteButton key1 = { 13, {note(B, 4), CHANNEL_1}, }; // Note B4 on MIDI channel 1 // Piano Note - Another way to choose a note is to type a midi number. // Wire a button to pin 12 NoteButton key2 = { 12, {45, CHANNEL_1}, };// Note C4 on MIDI channel 1 //DrumLeft -On the purcussion channel (channel 10), // notes don't exist - only sounds, like bass drum or bongo. // Wire a piezo input to A1, which is Analog pin 1. NotePiezo drumLeft = { A1, {36, CHANNEL_10}, // }; //DrumRight // wire the piezo to A2, also known as Analog 2 NotePiezo drumRight = { A2, {40, CHANNEL_10}, // Note C4 on MIDI channel 1 }; // Wire each of these to their pins (A3, A4, A5, etc) depending on your own wiring // and choose a sound for each (1-81) NotePiezo drumTopRight = { A3, {40, CHANNEL_10}, }; NotePiezo drumTopLeft = { A4, {40, CHANNEL_10}, }; NotePiezo drumCenterRight = { A5, {40, CHANNEL_10}, }; NotePiezo drumCenterLeft = { A0, {40, CHANNEL_10}, }; /************ Start running *************/ void setup() { Control_Surface.begin(); // Initialize Control Surface // This takes the background noise and makes it the minimum threshold for a hit. // What this means is that the background noise won't make it randomly go off, // so you don't have to play with the code at the same time as the electronics. drumLeft.setHitThreshold(drumLeft.sampleSilence(400)+1); drumRight.setHitThreshold(drumRight.sampleSilence(400)+1); } void loop() { Control_Surface.loop(); // Update the Control Surface }
For Non-USB Arduinos - Download Hairlessmidi Serial Bridge
Any Arduino or ESP-32 that does not have built in USB Host support (like the ESP-32, Arduino Uno, or Arduino Nano) will have to communicate using separate software, in this case, HairlessMIDIserial. This lets the Arduino communicate with MIDI software over serial rather than act like its own device.
Linux users will have to open the MIDI software before the next step. I recommend Qsynth.
Windows users should download loopMIDI, which creates a virtual MIDI device for hairless-midi-serial to connect to. When you open your MIDI software, it will see a device called "loopMIDI."
Once you have HairlessMIDIserial installed, connect to the Arduino by clicking the left dropdown and selecting the serial port the arduino is on. Then, on the right side, click the MIDI port you are using (loopMIDI on Windows. Probably FluidSynth on Linux.) See the HairlessMIDISerial photo above.
Start Playing!
Now it's time to start playing! I'll try to get a video out within the next few days.