An existing MIDI library reads the note pitches and timing from MIDI files. The Arduino then activates the corresponding solenoids, striking the xylophone’s keys in sequence. The circuit is explained in the electronics section below.
Once I had chosen the dimensions of the custom solenoid, I planned to 3D-print its body and support. Unfortunately, the print failed, so I moved on to a different approach. The original design turned out to be workable after all: my mechanical engineering friend Malak adjusted the printer settings and got it to print correctly. By then, though, I had already built the alternative :/
I used a hair straightener to melt the glue. Its broad heated surface made it easier to spread the glue evenly, which was faster and more convenient than using a glue gun.
I drilled holes in a wooden support to hold the solenoids. It held them firmly and was simpler to build than the 3D-printed design, so I used it for the final mount.
Adding a permanent magnet on top can dramatically increase the force for the same electrical input, but I chose not to use one because:
The Arduino’s digital pins have a current limit of around 40 mA (each solenoid needs about 1.2 A) . To activate up to four solenoids together, I needed an external 5 A supply and switching components. I ruled out relays because their mechanical clicks were audible and they were not a good fit for repeated rapid switching.
My longer-term goal is to recognize notes from sheet-music images and send their note indices & timing to the Arduino. For now, the system uses MIDI files, with the following software pipeline:
You can use this website to find MIDI files, or search online for the piece’s name followed by “.mid”.
LMMS is the digital audio software I used to:
We Wish You a Merry Christmas
FĂĽr Elise
Alla Turca
The Stars and Stripes Forever