Let’s Learn How to Play and Make A Piano

For all those music buffs out there or beginners getting into the art of sound, here’s a quick way to generate your own buzz — but in a creative way. Music is one of the best ways to gather people together. If you’re ready to start on the path of a modern-day Beethoven, then it’s time to gather some parts and get started.


For those of you who don’t have a solid grasp on music mechanics, I’ll provide a little music lesson.

There are seven notes that exist in a musical scale. A through G are the notes that can be played, along with some notes that are sharp and flat. When reading music you have to remember what notes are what on the scale. For the treble clef staff there are handy ways to remember the notes. The open spaces in the staff can be remembered by spelling “FACE” while going from the bottom to the top. So F is the bottom space and E is the top. The lines can be remembered by “Every Good Boy Deserves Fudge.” The bottom line is an E note and then the top line is an F note. Remembering that will help with reading your music.

Image from Teoria website
Image from Teoria website.

So after this brief lesson, you shall now begin constructing a piano. Of course a piano has so many keys and since there is only so much space in our work area so the piano will be shortened to just one octave of keys. The first key will be the middle C key (C4) and the last key will be the B (B4) key in that octave. All the sharps and flats, the black keys, will be included in the design.

Image From Wikipeadia.

You will need 12 pushbuttons and 12 10KΩ resistors along with some wires. The base of the piano will be a breadboard and the speaker will be a piezoelectric speaker. A chipKIT Max32 board will work perfectly for this project. The application MPIDE will need to be installed on your computer to code the chipKIT Max32.


Plug all the buttons into the breadboard and connect the wires in the correct spots. Make sure to remember what button is plugged into the correct pin that you want. Align all the resistors in the correct spots and then you will have a physical mini-keyboard. When the resistors are facing you, the buttons will read (from left to right) C, C sharp, D, D sharp, E, F, F sharp, G, G sharp, A, A sharp, and B. The only thing left to do is to have it make music.


When coding your piano, you will need to know the specific frequencies of each note. There are websites that will tell you the frequencies. If you want to make your own piano with different frequencies, you can! I would recommend you read James’ post about creating music. It would be a good idea to define the notes at the beginning of you program so that you don’t have to remember them later. You will need to define each button with the pin that it is plugged into. Make sure you have your piezoelectric speaker plugged in too.

bttns freq setup

The use of “If” statements are ideal for having each button only playing one note at a time. There are other ways you can do this, but this is a simple way to do it. So if your C button is HIGH, it will play the frequency of the C note. There is a handy playFreq function on our Learn site that you can use to make sure your button is playing the correct frequency. Make sure that the code will loop through all of your statements to keep playing the same note. Once your code is all done you and you upload it to your Max32, you can now play all the music you want.


You can also enhance this piano. You can add other buttons for more notes, or you could make a switch that can change to a different octave. Get creative with your music making and circuit design! If you would like to see the full how-to make, check out the Instructable for this project.

Be the 1st to vote.

About Robert Prew

I am studying Electrical Engineer at the University of Idaho. I have always been interested in technology, video games, science and learning new things. I always believed in the saying “if you can't explain it simply you don't understand it well enough” by Albert Einstein. I have a thirst for self discovery and learning new things about myself. Bringing joy or making others feel happy gives me a great pleasure. You can usually get me interested in an activity that has a more hands on approach. I will always try and strive to be the best person I can be.

View all posts by Robert Prew →

One Comment on “Let’s Learn How to Play and Make A Piano”

  1. Great blog! I am a lover of piano, I learned music so long back. I have composed several kinds of music albums it is really nice. Music is an art I really appreciate the blog for such wonderful Information.

Leave a Reply

Your email address will not be published. Required fields are marked *