We’re making MIDI drums! If you’re making a drumset from scratch,
you’re gonna have to get these piezo sensors and also drum pads
and you’re gonna attach the piezo sensors on the bottom of the drumpads
or if you can find one these guitar hero drumsets which are basically drumpads with piezo sensors
on the bottom of it, it’ll save you a lot of time
and they’re really easy to open up. I’m going to show you how I opened mine.
I got mine second hand for $20. If you were to build yourself one,
the cost of drumpads would set you back a lot more than that already.
So let’s get to it! Arduino MIDI drum tutorial! We’re going to need an Arduino,
I chose to use the Arduino UNO because I only needed 6 analog inputs
but if you have more than 6 piezo sensors, then you can go with the Arduino Mega which
has 16 analog inputs. We’ll also need a proto board.
For every piezo sensor, we’ll need a 1MO resistor. And also 1 220O resistor for the MIDI port.
A loose MIDI port and male pin headers. If you’re constructing the drumset, you’ll
also need piezo sensors. Lots of those.
And drum pads! Lots of those too.
And you’re going to have to design some kind of structure
to hold your drumpads. But seriously, save yourself the trouble.
Just go to your friends place, and jack their guitar hero or rock band controller.
No one plays that game anymore. I’ll be using the guitar hero world tour controller
in this video. It’s got 3 drum pads, 2 cymbal pads, and a
pedal. On the back panel, there’s even 2 stereo 3.5mm
audio jacks – one of which connects the bass pedal.
and the other we can save for any further modifications to the drumset.
Also, this set comes with a MIDI input port. Which is perfect, because we’ll just save
a MIDI jack and rewire this port internally and turn it into a MIDI output
port. So now let’s talk about the Arduino circuit.
To wire up a piezo sensor, we’re going to put it in parallel with a 1MO resistor.
Then we’ll take the voltage readings across the resistor by
hooking it to one of the analog pins on the arduino and ground. We’ll do that for each sensor, on each of
the analog pins. Then we’ll take our MIDI port, and hook it
up as MIDI output, like so. We’re also going to bring a line from the
serial output of the Arduino, which is pin 1 on the Arduino UNO, and hook
it up to this pin on the MIDI jack. And that’s it! Now let’s go through the Arduino program.
When the piezo is hit once, it creates a signal like this.
And since we’re using the Arduino analog pin to read this signal,
all negative voltages are read as zeros, so we only get the top half of the signal. We’re going to apply a small threshold to
this signal and ignore anything below the threshold.
We do this to prevent any unwanted vibrations that the piezo might pick up to trigger and
MIDI notes. We then keep a buffer of each of the local
humps. Then looking at the overall shape of the local
humps, we detect when the signal is increasing. At the peak of the signal, we’ll send a MIDI
note through the serial port of the Arduino with the velocity of the note based on the
amplitude of the peak. And here’s what all this sounds like… So now that we know what the code is doing,
go ahead and download it from the description box below.
Before you upload it to the Arduino, there’s a few definitions which you might
want to tweak to suit your needs. At the top, set NUM_PIEZOS to the number of
sensors you have. Just below that are the threshold values I
set for each of my sensors. You can tweak these values to see what works
best for your drumpads. And also you can remap these definitions to
different analog slots here, depending on how you decided to wire up the
piezos. The START_SLOT definition analog pin of the
first piezo. And the START_NOTE definition is the MIDI
note of the first piezo. The following are MIDI defines and program
defines, you won’t have to touch anything there, and
you can just leave the rest alone. Okay now we’re going to crack open our Guitar
Hero controller! After you take out the screws on the back
and unhook the controller dock, we can lift the back plate, and access the
piezos. You can see that the piezos are plugged in
directly to the mainboard. The other board on the top just holds the
back panel, and all the inputs of the back panel are
plugged into the main board directly as well. We’ll just unscrew the main board, and replace
it with our Arduino. It even fits perfectly in the same screw holes! So we’ll have make a shield for the Arduino
where we can plug in the piezos into. We’ll go back to our circuit, and condense
all this onto a protoboard. First we add some pin headers on the board
to match the pins of the arduino, so that we can snap the proto board on top
like a shield. Then we’ll take our resistors and connect
it to a common ground. Then we take our pin headers, break them into
twos, and solder one end of each of the these to the
other end of the resistors. Then we connect the other pins of the headers
to ground as well. Now we can just plug our piezos directly to
these pin headers. We’ll also add one more pin header for the
MIDI port, like so. When you work with the pin headers, it’s a
good idea to plug them in to the Arduino first before you hot glue them onto the protoboard,
this way the pins won’t be slanted, preventing you from snapping the shield in
the right position afterwards. Okay! So after a bit of soldering and lots
of luck, This is what our shield should turn out to
be. And also – since we’re reusing the MIDI port
on the back panel of this controller, we’ll need to make a slight modification to
the back panel board. By adding a jumper between these two pins,
we can ground the middle pin of the MIDI port which would otherwise be missing
for a MIDI output port. We can then plug the last four pins of the
cable ribbon directly into our proto board. Now let’s put everything back together.
We’ll plug in our MIDI port, and one of the piezos, and give that a test.
When that works the way it should, we’ll proceed and plug in the rest of the piezos And when everything’s clear, all that’s left
is to close up the unit. And that is it! And now the most important outcome of all
this – we can play Drummania! Yes, I know, I took apart a Guitar Hero Drumset
to play Drummania. Worth it! If this project helped you, give me a thumbs
up or leave a comment below and let me know what you want to see! Later!