Instructables
Picture of A position sensitive midi drum pad


The SynPad is a position sensitive midi drum pad that you can build yourself using simple materials and tools for around 50 UK pounds (depending on what materials you already have, and how many pads you want to make.) The pad can detect where you have hit it as well as how hard, so that the synth it is driving can change the sound continuously as you strike the pad in different places.

The software I have written to make the sounds is currently linux based, but would not require much work to adapt to a windows or mac environment.


The skills you need are basic wood and metal work (cutting and drilling), enough electronics knowledge to build a simple circuit from the schematic, and a moderate amount of experience with making music on the linux operating system. You don't need any programming experience to start making sounds under linux, but would if you want to create your own synths to make different sounds, or to port the program to another OS.

If you have built one of these pads, or are thinking of building one, it would be good to hear from you.

Hope you enjoy making and playing this instructable!

 



 
Remove these adsRemove these ads by Signing Up
1-40 of 49Next »
doggyd69b1 year ago
I just converted my acoustic set into an electronic set. I am currently using the Alesis I/O you can find it on Ebay or Amazon for about $ 150 dlls. new even cheaper used.

I will post a much more detailed tutorial of the whole process from making your own mesh heads to making your custom sensor mounts and the very little electronics involved in each double zone drum. Yes I know that you are building your module from scratch but this may help others less electronics savvy.

Great job by the way.
ganglion (author)  doggyd69b1 year ago
Sounds like a neat project - have fun!
H4T4 years ago
I was wondering if you could generally explain how your circuit works? Am I correct in thinking that your circuitry on the left is basically a fancy diode / one-way valve? It looks to me like it is supplying a constant 5V power to all piezo sensors when none of them are in use, and uses the op-amp to supply voltage directly from the piezo sensors themselves if they are hit with enough force to overcome the 5V battery.

But I was just wondering, why not just use a diode?
ganglion (author)  H4T4 years ago
The reason for using that circuit is because I wanted to be able to track negative going as well as positive going pulses from the piezo. When you hit it, it starts going positive, then oscillates both negative and positive. If the negative terminal of the piezo was just connected to the ground of the arduino, the negative part of the pulse would be below ground, and wouldn't be picked up by the ADCs.

What this circuit does is to halve the input voltage using a voltage divider, then use an opamp / transistor buffer to provide a constant voltage at that level (roughly 2.5 volts). Then when the voltage from the piezo goes negative, it's relative to that 2.5 volt false ground, not to the ground of the arduino.

The program on the arduino does a short calibration when it starts up to work out what the resting voltage from each piezo is. That value is then subtracted from each reading.

There might be better / simpler ways of doing this, but that's the way I did it in my first version, which I'm still using, and it seems to work ok.
H4T ganglion3 years ago
cool, thanks!

I've taken another look at the circuit and brought up the datasheet for the TS912 and noticed a problem. In your schematic you have your ~2.5V output of the voltage divider section going into pin 1 of the TS912. According to the datasheet below, pin 1 is for output....are the pin numbers just incorrect in your schematic, or did you use a slightly different chip?

http://www.st.com/stonline/products/literature/ds/2325/ts912.pdf
ganglion (author)  H4T3 years ago
Sorry about that. You are right that the pin numberings are wrong on my circuit. I'll put up a corrected version in a minute.

The 2.5v divider should be feeding into the non-inverting input of the op-amp (pin 3), the feedback from the resistor should be on the inverting input (pin 2), and the output to the piezos should be on pin 1. It wouldn't hurt as well to put a high value electrolytic capacitor (100 uf?) across the 100 ohm resistor to make sure that the current into the piezos isn't drawing the ~2.5V rail up or down in voltage.
Thanks for the fantastic instructable. I'm trying to adapt your circuit to make a detector for a BB gun shooting range, so we know when we hit the targets. The way I have the circuit set up now is too simple, just the piezos and the 1M resistor, and its very susceptible to electronic interference. So I'm building out your circuit now to try to make it a bit more reliable.

I had one question: I wasn't able to find the TS912 op-amp locally, but instead found the TL082. The package is labelled "Dual BiFET Op Amp", and here's some specs:

http://www.national.com/mpf/TL/TL082.html

Do you think that would work as a replacement?

ganglion (author)  wrybread3 years ago
Interesting use for this circuit! :-)

Bear in mind that just using this circuit won't make your system more reliable - the reason for creating a 2.5v reference level like this is so that the firmware can detect both positive and negative going pulses from the piezos. Apart from that it will work pretty much like the simple input circuit you are using. Are you using shielded cable for the connection between the piezos and the arduino? This would help with reducing interference.

That opamp might work, but I'm not sure. It looks from the datasheet like it's designed for a higher voltage application, with split power supplies. The useful thing about the TS912 is it is 'rail to rail', which means that its input and output voltage ranges go right from the positive to the negative supply voltages. Also it's designed for low voltage applications (2.7 V minimum).

This isn't a very demanding use for an opamp, but it does need to be able to provide an output voltage of about 3.1V to drive the transistor. I'm not sure from the datasheet whether the TL082 will do that off a 5v single rail supply.

If you search for a general purpose rail to rail op-amp, you should find something that does the trick.
ganglion (author)  H4T3 years ago
P.S. I can't get the circuit designer I'm using (GNU EDA) to remove the wrong pin numberings from the op amp, so I've just put up a new version with no numbers. The '+' and '-' signs on the inputs should be enough for people to read the schematic, I think.
H4T ganglion3 years ago
Thanks, things make a little more sense now! :P

Did you also happen to change the resistor values across each piezo from 10M to 1M? Or am I remembering it wrong?
ganglion (author)  H4T3 years ago
They were always 1M as far as I remember.
Hi ganglion
this looks deceptively simple, but as engaging as Randy Jones' physical drum model:
http://vimeo.com/2433260

before I try to emulate your hardware system, am I right in assuming you are using the Z-axis (force/velocity) from the piezo's as well as X/Y location? I wonder if four FSRs (under foam, then perspex) in each corner would work just as well?
ganglion (author)  brendanmccloskey4 years ago
Yes, the velocity value is worked out from the sum of values in each corner. For the position, I use a least squares curve technique to fit an equation to a set of calibration data.

Not sure about FSRs (force sensitive resistors?). They might be worth trying, and could work perfectly well because really it's just sensing the transferred pressure at each corner, but I don't know much about their properties.

I guess the thing would be to go ahead and try it - it would be good to have someone experimenting with a different physical construction, so let me know how you get on.

andy
Thanks
I'll have a prototype ready in the new year
jsandeef4 years ago
This seems like it could work in a circular form, to simulate a multi-zone snare or cymbal. How accurate are the coordinate calculations? I'm a n00b to Arduino and my only experience with programming is a few C++ classes, but based on the code I've read, this might be something I could try. I'm still waiting for my first board to arrive next week, though.
You may have good luck constructing a square pad but overlaying a round frame on top of it. Then you can modify the code to ignore all piezo signals or coordinates that are from strikes in the corners of the device that you don't want to be active.
ganglion (author)  jsandeef4 years ago
A round pad might be possible - the question would be how many piezo sensors to use and where to put them? The advantage of a square pad is that you can map the x and y coords easily onto 2 independent midi controllers, whereas for a round one it's hard to see how you would bring in the second dimension.
jsandeef4 years ago
Oh, I just read that the accuracy is within 5%, which is pretty good, given what you worked with. Great job!
ganglion (author)  jsandeef4 years ago
Thanks! :)
ganglion (author) 4 years ago
 If you make one of these, it would be nice to know how you got on, so feel free to send me a private message.
XsavioR4 years ago
Perhaps using multiple PIC micro controllers one per "zone".  If you like I have code examples of ASM serial driven midi, and USB2.0 midi using Microchip demo code.  You could get quite a few PIC for the price of an arduino, and it would lend to multi tap ability. Also it would be directly plug and play with apps like reason, virtual dj , (those are the two I use to test)
ganglion (author)  XsavioR4 years ago
 I don't see how you could do this and keep the continuous x-y controllability. The idea of this pad is that the x and y coordinates vary smoothly as you tap in different places across the pad, so splitting it into zones would spoil this.

You could make a pad with an array of piezos controlled like you say, but that would be a different project.
Like a kaos pad I see. Then shouldnt some code make it read 2 taps. Some maths. All two taps on a kaos pad is is an average of the x y coordinates.
 I was just going to ask about that. If you hit the pad with two fingers simultaneously do you indeed get an XY value at the midpoint or average of the two points (i guess that would depend on whether or not both fingers strike with the same velocity)?

XsavioR: your idea later in this thread about using a master and slave PICs to speed up the process is interesting, you should pursue the idea.

ganglion: You don't have to believe in patents for someone else to take the idea out from under you. This project introduces some tech that has some pretty awesome potential and if you apply it in the right area (buttonless drum pads for instance) audio geeks with eat it up like crazy. But luckily for all us hobby enthusiasts you put it out there in the public domain, which I can definitely appreciate.
Im working on a web based , rfid , security / monitoring / control device. :) ive got my hands full :)
XsavioR XsavioR4 years ago
PS what i meant was use some small PIC for each input, then poll them all at one time using a master PIC , basically out put binary from the 8 pics , then poll the results, do some math on the master and output the MIDI signal. It should be fast enough to surpass the 10ms the human ear can hear, given the right oscillator on the master pic.  Definitely another project but  interesting no less.
ganglion (author)  XsavioR4 years ago
At the moment I'm happy with the arduino - it's easy to work with and quick enough to send the raw sensor data to a computer for further processing. What you are talking about might be good if you wanted the whole thing to be self contained and just send midi data, but I'm happy with that side of it the way it is at the moment.

The thing I want to do next is clean up the physical design a bit, and maybe paint it, and then work on making it possible to have several pads running at the same time.

What I'm planning to do is drill holes in the base to bring the cables to the bottom of the base, then add some thick foam rubber to lift it high enough up to fit an arduino pro-mini with a mini-usb connector on a bottom edge. That way you just need a usb hub to plug in several pads at the same time.
ganglion (author)  XsavioR4 years ago
 I think the code I already have would do that, because it's just based on working out the distribution of pressure on the sensors between the 4 corners.
 If you can find a shop to make you a sleek chassis to house the components, you could sell them if they're a good price.  Let people tweak the sound effects and you'd have one cool computer peripheral instrument.
ganglion (author)  spydercanopus4 years ago
 I'm thinking thati when I have improved the design a bit, I might sell a few to people who are interested, but I'm not planning on doing this in a big way.
Inventors rarely see the value of their brain childs.  You have something really cool here.
ganglion (author)  spydercanopus4 years ago
Thanks :) . It's just that I went through all this in my head when I was working on it and considered various options. One thing was all the issues about patents (which I don't really believe in) versus open hardware, but the main thing is I'm not really up for trying to run a business at this point in my life.

Also if I was trying to make something like this for a mass market, I probably wouldn't do it that way - I would spend time researching something like surface acoustic wave touchscreen technology, and do it in a more sophisticated way.

The point of this project for me (apart from having fun making something I could play myself) was to make something simple that anyone could build themselves out of simple components.
yeehacmh4 years ago
I always wanted a system like this on my car's steering wheel. Maybe a couple buttons on the free foot on the floor too. You know how you're bopping down the road and you're beating on the wheel to your favorite tune. This could be added to the audio output speakers and you would become part of the playback.

Haha, that would be too awesome!
jasonwebb4 years ago
 Have you considered using the Arduino itself to extrapolate the sensor data and output MIDI notes directly, perhaps through a true MIDI cable? 

I see the Python code has some potentially CPU intensive math so it may introduce an unacceptable amount of lag if ported to the Arduino, but maybe not, especially if you upgrade to a more powerful Arduino or clone. 

In practice do you find that the calibration functions you have written help much? Or did you introduce that because you noticed noise in the system? I would like to see if this device can be optimized into a more plug-and-play package. This sucker has some fantastic potential.
 Also, what is the equation you use to integrate the the piezo signals into an XY position? I'm just going to copy the code, but was just curious if its a well-known equation, maybe there is a reasonably analogous alternative function out there for CPU calculations.
ganglion (author)  jasonwebb4 years ago
 I just made the equation up, based on having thought about what the likely form of the relationship should be from the physics, and then used calibration and curve fitting to fill in the detailed coefficients (e.g. to allow for some sensors being more sensitive than others)
ganglion (author)  jasonwebb4 years ago
 I did try running it with some simpler equations and less calibration, and it didn't work so well. (less consistent x-y coords). You could probably put at least some of the python code onto the arduino - I wrote it that way for the convenience of python as much as anything else. One way to do this would be to keep the calibration code on a computer, but once it is calibrated you could upload the coefficients to the 'duino and just feed the strikes into the equations and generate midi data that way.

Personally I'm happy to have it split like this because the synth at the end is in supercollider so needs a computer to run on anyway. Also I am planning to add some extra functions to the midimapper which would be hard to do on a 'duino just because of speed and memory constraints.
jasonwebb4 years ago
Now THIS is a sweet project, can't wait to try this myself; I love the simplicity of it! :)

Does your pad handle simultaneous taps at all? I'd imagine that multiple simultaneous taps may cause dampening of the vibrational waves, but maybe in practice its not too bad.

And using Python on Linux for 'duino serial data? That's f*cking hardcore, lol :P
ganglion (author)  jasonwebb4 years ago
 Thanks. :)
It can't do simultaneous taps but the retriggering delay is quite short (15 msec), so sometimes it almost sounds like it can.
1-40 of 49Next »