I've been working on this on and off for 4 years. Finally I got it to play something. As you can notice, there's a lot of calibration to be done.
The hit is performed by moving the mallet to a defined height above the bar. Then the mallet moves to a lower defined height. The speed of the mallet and the flexible stem makes it travel further and hit the bar, then return to the defined lower height (after some oscillating). Well, in a perfect world, that is.
I calibrated the whole thing so that the hits would sound nice. For that I used a MKR 1010, which communicated with Blynk on my phone. For actually playing midi music on this, I switched to Leonardo, to be able to output midi directly via USB to the Leonardo. Works like a charm.
But as you see, and hear, each hit is too hard. Nothing left of my calibration. I need something to adjust the overall dynamics in real time, while playing. Probably a potentiometer.
The paper wings on the mallets are there to damp the tremendous vibration of the mallets. I might have to add a device with a pole and a rubber sling to suspend the mallets to decrease the torque caused by the unbalanced mallets. That might decrease the vibration. Right now not only do the mallets hit too hard, they also hit the bars several times.
The quality of the servos appeared to be lower than what I expected. I went for fast servos, but I should have focused on other things. One of the vertical servos gets stucked every once in a while. I have to twist it a bit to get it going. What on earth is going on there? I have a spare on of same model, but the servos are glued with epoxy. Will be tricky to detatch.
I still hope to make the mallets react to the velocity parameter of the note on message. But adjusting the higher and lower position of each mallet and each bar is tricky. I thought I could just adjust the mallet to a nice fortissimo hit and a nice pianissimo hit and then just interpolate according to the velocity parameter. But so far I'm happy to get any sound without hitting the bars so hard that they jump off. Or to get any sound at all, instead of having the mallets just dance above the bars and not hit them.
I named the instrument charillino. Derived from carillon, which is either a large bell tower instrument or a music box. I have an idea of a charity project, where I'd use this instrument (together with others I have built). That gave me the final form of the name.
Here's a video of the calibrating process. For this process I use Blynk on my phone. Works great. When I'm satisfied, I dump the data from the Arduino back to the computer to be pasted and hardcoded into the code again.