Inspiration

For this project, we wanted to work with hardware, and we wanted to experiment with processing sound or music on a microcontroller. From this came the idea of using a gyroscope and accelerometer as a means to control music.

The project

The Music Glove has an accelerometer and gyroscope module combined with a buzzer. The user rotates their and to control the pitch of the music (cycle through a scale). We planned to combine this basic functionality with musical patterns (chords and rythms) generated from a large table of scales stored in flash memory, but we were unable to make the gyroscope work properly with this code.

Challenges

We were initially very ambitious with the project. We wanted to have multiple speakers/buzzers to make chords or patterns that could be changed with one axis of hand rotation ("roll") as well as a speaker to establish a beat that could be changed with the other axis of hand rotation ("pitch"). We also wanted to have a third input (in the form of a keypad with multiple buttons or potentiometer) to change the key of the music.

Memory constraints on the Arduino made it initially more appealing to use an MP3 playing module to contain different background rythm patterns. However, this proved to be difficult to combine with the gyroscope functionality, especially considering the gyroscope module would sometimes crash inexplicably. It appears that the limited number of timers on an Arduino Uno/Nano (three in total) can make combining different functionalities into a single sketch difficult. For example, each tone being played at a set time requires its own timer, but serial communication often also requires a timer. We were also unable to add a third input (keypad) for changing the key separately.

What we learned

We learned how to use a gyroscope and manipulate tones with an Arduino. We learned how to use various libraries to create sounds and patterns without a built-in digital to analog converter on the Arduino. We also learned how to use a keypad and an mp3 module, and working around combining different functionalities. Most of all, we had fun!

Built With

Share this project:

Updates