Inspiration
I am a programmer and a musician. I have always been interested in finding ways of tying my passions together. This was an interesting concept that I thought would be worth trying out. It was also a project that aimed to inspire my coding students to experiment with a music-based project over summer.
What it does
It was a project that allows us to create our very own custom musical instrument. It lets us use any conducting material through the touch sensing hat to trigger sounds that we configure in our program.
How I built it
We chose the Raspberry Pi 3B+ as it allows us to code in Python. The Adafruit Capacitive Touch HAT for Raspberry Pi - Mini Kit - MPR121 provided us with many touch inputs. We hooked up the conducting triggers (spoons in our case) to the hat using alligator clips. Next, we created a program to detect the touch inputs in a continuous loop. We utilized the Adafruit's library to detect the touch inputs (https://github.com/adafruit/Adafruit_CircuitPython_MPR121). We then triggered specific sounds for each touch. We used a speaker connected to the audio jack of the Raspberry Pi to listen to the output. In our project, we used one octave of piano sounds to be able to play a recognizable tune.
Challenges I ran into
One of the main challenges of the project was to be able to get low-latency in the triggering of the sounds.
Accomplishments that I'm proud of
I am proud of how well the instrument played and also the excitement among the students when I demonstrated it to them.
What I learned
This was a my first experience with a large touch sensing hat. I also better understood the need for buffering of sound and audio in such applications.
What's next for Building a Configurable Musical Instrument
The next step would be to create a nice box / outer case for the instrument. Or one can come up with a different GUI using PyGame or Tkinter.
For more on this project and other such related projects you check out our blog post : https://www.youngwonks.com/blog/Coding-Summer-Projects-for-Kids-Using-Raspberry-Pi
Built With
- python
- raspberry-pi
- touch-sensing-hat
