♫♫ ##Inspiration ♫♫

Wouldn't everyone like someone to sit in their house and serenade them on the piano? With any song they want? Wouldn't it be easier for everyone to learn songs on the piano if there was a machine that simply listened to songs and taught it to them? Why should you listen to music through a speaker when you could have it played live in your house? Introducing Happy Keys.

🎹🎹 ##What it does 🎹🎹

Happy Keys will...

  1. Listen to any song that is either played/sang at the machine or an audio file uploaded to our software.
  2. Simplify the song to a series of notes that can be played on the piano and their respective durations
  3. Play this song for you on the piano

⚙️⚙️ ##How it works ⚙️⚙️

Software (identifying how to play the music): Fourier analysis is a method for expressing a function as a sum of its periodic components. Using a python library called Librosa, we used this analysis to simplify a complicated song into a series of notes composing the melody. We then measured how long these notes are played in the song to measure their respective durations. This information gets exported to an Arduino which in turn controls the hardware.

Hardware (playing the notes): The hardware consists entirely of 2 micro controllers, 4 stepper motors and their drivers. We were fortunate to have had 2 stepper motors beforehand which made the access to resources a little easier, but still challenging. The power must come from multiple sources since all the piano and different motors have different consumptions and requirements. The Piano must be plugged into the wall, the NEMA motors use batteries in series to get the recommended voltage. The 28BYJ stepper motors take advantage of the voltage regulator on the Arduinos and obtain their 5 volts from the batteries as well. An external battery pack is also used incase of deficient current.

💪💪 ##Challenges we ran into 💪💪

  1. Integrating python and C++ code in the Arduino IDE. Our software was coded in Python but we coded our hardware in C++. Unfortunately, Arduino IDE best works with one file in one language, so this integration was generally difficult.
  2. Power source resources and wire management. We had trouble finding enough power, with the right voltage and current to power our hardware.

🎩🎩 ## Accomplishments that we're proud of 🎩🎩

  1. Some of us learned to code in C++ or Python.
  2. Powering the stepper motors
  3. Using Python to control the Arduinos
  4. Using LT93D Arduino Nano and Nima Motor together

What's next for Happy Keys

Currently, our project can only play 4 keys. This is obviously due to lack of materials and sufficient power. However, going forward, we plan to simply replicate the same machinery across more keys, possibly over the whole keyboard. We also coded the project in Python so the code is not as efficient as it could have been. Coding the project in C++ or a more efficient language would reduce any delay times we encountered and be able to play very advanced songs. Hopefully, at the same speed as a human. Finally, we would like to attach our machinery to the hardware of the piano (the inner machinery) in order to make our product work better.

Built With

Share this project:

Updates