Note to reader: This project is still in the works and one I really want to complete at some point. I haven't really experimented much since May, as I've been steeped with AP prep, school exams, and now, college applications. I have, however, researched made progress in the codes, but I haven't had time to add it in this blog.
As this blog serves as a detailed report of my progress, I'll regularly update this blog on my progress as and when I have time.
Thank you!
Music has always been around me. Being a drummer since I was 9 years old, I can’t stop drumming, humming, tapping and head-bobbing wherever I am. In 8th grade, I discovered a beautiful way to entertain my reckless musical thoughts - playing drums on the table. In a boring history class(I like history...that class just happened to be boring), as a Megadeth song played in the back of my head, I brought my palms to the table and began beating it lightly. Before long, I realized that I could create quite well-sounding beats with my two hands by striking the table in a specific way.
By thumping the table with the hard part of the hand between the palm and the wrist, I could create a booming bass sound.
(I strongly advice the use of earphone/headphones when listening to this and all the following recordings in the blog. You won't hear the ghosted notes without them.)
By flattening my hand and striking the table with my fingers by pivoting the hand about the wrist, I could create a flat snare sound.
By slightly cupping my hand and striking the table softly with the second half of the length of my fingers, I could create a high-pitched hi-hat sound, or a soft ghosted-note sound, depending on the beat.
With these sounds, I could create basic rock beats.
Within a few months, I got pretty darn good at it - I could combine paradiddles and other hand-movements to create more complex sounds, cover many songs to an appreciable degree, and replicate many drum-kit solos.
But there was a problem. My beats sounded good only as far as simple beats were being played - for example, people could understand the basic boom----chick----boom-boom---chick beats. When the groove got a little more complex and fast, it would begin to sound like noise to most audiences.
However, it didn’t sound like noise to everyone - all the musicians in my class absolutely loved it - they would hype me up, bob their heads and even air guitar to the song I was playing.
The only reason it doesn’t sound like music to everyone is that it’s after all not an actual drum kit. To a common man, only the attractive drum-kit sounds would sound like music. It stayed like this for years as I continued to play drums on the table and annoy teachers in the process.
But in the middle of 11th grade, it got me thinking - if I could create a musical environment with just my hands on a table to musicians, wouldn’t it be great if what I played on the table could be translated to actual drum beats so that everyone could enjoy them?
I was excited at the opportunity to pursue this idea as in the past few years, I had tinkered with electronics and written programs for many other small projects. I had a certain knowledge of math and electronics that I didn’t have a few years ago. As the problem-solver in me got to thinking, I set out on a project to bring the drum-kit to the table.
To bring a little perspective, lets hear what we're dealing with
What if I played this...
And those around me heard this...
It would certainly not be noise to anyone anymore
Now obviously it would probably never sound like that. What you just heard was a studio recording of a drummer playing a high-quality drum kit. If, however, I could replicate it to even a small degree, it would make a huge difference in my opinion.
So here's how I went about the project...
The problem was by itself simple:
Keep a ‘drum pad’ at different locations on the table where a part of the hand would strike
Read in a signal whenever that part of the hand strikes its ‘drum pad’ and register how hard it struck the pad
Create a sound that corresponds to which drum pad was struck and how hard it was struck
When I first imagined the idea coming to life, I imagined something like this:
Those circles are drum pads that would pick up signals, send it to an arduino, and the Arduino would control a speaker to play the sounds.
Now I had to figure out a way to do all these.
Sensors. The first thought that came to my mind - there’s got to be some kind of pressure sensor to help pick up my tapping.
I first thought about a strain gauge.
A strain gauge measures weight, and is used on many kitchen scales. In fact, I got this idea while opening up a broken weighing scale in the house. A strain gauge is essentially a metal rod/cuboid, on one end of which is placed a heavy load. This load results in a slight bend in the rod. In the top and bottom of the rod are placed length-dependent resistors(let’s call them transducers). When the rod bends, these transducers bend too, which increases its length, and that increases its resistors. These changes in resistance correspond to the weight of the object.
The strain-gauge, however, didn’t work. It did register the drum taps as I tapped it with my hand(I had to pick a very sensitive transducer) but the register was slow. It took about quarter of a second to register the signal, and another quarter for the signal to die down.
I haven't talked about how I obtained and measured these signals as it would divert from this topic, but mainly because I will talk about it later.
At this point I realized a few things:
The sensor would have to pick up the signal FAST, and be able to reset itself to cater to the next drum beat immediately.
The signal-time graph would have to be steep and narrow. Let me explain:
As you can see, different pressure sensors would produce different curves. What I want is a narrow curve so that the signal is picked up immediately(no lag), and drops back down to make sure my next tap/beat is registered.
After eliminating the strain gauge, my next thought was simply pressure-dependent resistors. These are pretty simple - they’re just two slightly separated metal plates on top of each other. The higher the pressure applied, the better the contact between the two metal plates, and thus the lower the resistance.
Unfortunately, I never tried it. During the lockdown very few stores sold these resistors, and the ones that did sold them for exorbitant prices. After the lockdown eased up 4-5 months ago, however, I was steeped with other work so I couldn’t continue with this project. I had an internship to work for, SAT prep, and college application work. I do plan on going ahead with this project immediately after college application season is over.
My third and final idea were something called piezoelectric sensors. These look like small plates and use a special kind of material that generates a voltage at its two ends when any force is applied ot it(piezoelectric sensor). In fact, the gas lighters we use in our kitchens that create sparks use piezoelectric sensors - the button we press hits the piezoelectric crystal which then creates a voltage that results in the spark.
This sensor showed promise because of two main reasons: it was pretty cheap, and its purpose was to detect short pulses and/or vibrations, which is what I want.
Now the usage of this sensor is quite simple. Since the voltage produced is proportional(scale unknown) to the mechanical force applied on it, the voltage is a measure of how hard the drum sound should be. How do we read voltage? Here’s where our Arduino comes into handy - its analog pins can detect voltage. I’ve connected a 1M Ohm resistor between the positive and negative of the sensor to protect the Arduino from an over-voltages spike in case the sensor produces a voltage greater than 5V.
Now that we’ve connected it, I want to be able to graph readings to better visualize it. My intention is to tap the sensor, just like I would do on a table, and get its readings on a graph.
What better way to do it than to use Python? In my blog ‘Arduino to Python - Serial Communication’, I showed how Python can easily circumvent the inadequate graphing and visualizing capabilities within the Arduino IDE. Instead of graphing the sensor readings in the Arduino IDE, we transfer the readings from the IDE to Python using the serial library. The code I used for this is not really important right now, but you can read this for more information.
Now the question is how do we use it? Do I tap on the sensor itself? Do I tap on some kind of slab which would in turn tap the sensor to produce a more consistent evenly distributed force?
I first tried tapping directly on the sensor and the results were awful - they were inconsistent, as taps with the same intensity would give very different readings.
I figured I needed some physical interface which could smoothen out the pressure I apply. My first thought was a kind of diaphragm - a cylindrical diaphragm with a thin top(where I strike my hand) and the sensor at the bottom. This would mean that my taps would create an air pressure created inside the diaphragm which would reach the sensor. The sensor would sense that air pressure.
Here's a diaphragm made from the top of a peanut butter jar:
The piezoelectric sensor inside the diaphragm:
The circuit:
(More updates to come! Come back soon! :)
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
Comments