I have been working on a fun project to make an exhibit for my local makerspace to take to events. I had a ton of spare ultrasonic sensors lying around so I decided to experiment with turning them into a musical instrument. This video shows the current progress.
The code is very simple. The Raspberry Pi is polling each sensor (with the help of an octasonic breakout board that I designed about a year ago) and translating the distance into a MIDI instruction (“note on” or “note off”). These MIDI instructions are then piped into the stdin of a fluidsynth process, which converts the MIDI instructions into music.
This is my first exposure to MIDI and I love how simple it is to hack music. I’ll post an update once we have this project finished and mounted on a frame.
I have written up an instructable with detailed instructions on how to make this project.