I’ve had some requests for a diagram of the circuit that I use, and I’m going to post it with the proviso that no one should actually imitate this design. Partly due to my own ignorance at the time, and partly due to a failed attempt to isolate the power electronics from the Arduino, I used a combination of an opto-coupler and an NPN transistor where a single PNP transistor could have been used. But for the curious, here it is:
When I have nothing else to do, which will be approximately never, I’ll rebuild the circuits with PNPs and eliminate the opto-couplers, which I suspect damage the switching speed of the PWM signal. I don’t have a scope to verify my hunch, but it would make sense; optos are used in compressors because they smooth out a signal, which is the opposite of what I want. Right now, everything works, so this is a lower priority.
I received a helpful email from Richard West about dealing with solenoids that spontaneously activate and try to burn down my apartment. Since I posted about the problem, I arrived at a solution that uses software instead of circuitry; I simply have the Arduino send a clear message to the TLC5940 if the Arduino has not received a Note-On message in the last 4 seconds. Richard’s hardware solution would provide an extra degree of protection, and I’ll keep it in mind if I ever begin mass production of djembe machines. Thanks, Richard!
One of the reasons I was really annoyed by my burn-out solenoids–beyond the threat to my life–was that they’re fairly expensive. Each solenoid on the djembe machine costs roughly $45. The smaller ones on the bongo machine and hand percussion instruments run about $20. I purchase them from solenoidcity.com (yes, that’s a real website). Spatula City, anyone? I would love to do an endorsement deal with a solenoid company. Not for the money but because it would just be awesome.
As anyone who read the CDM comment thread knows, lack of expressive timing deviations in my performance bothered some folks, and rightly so. There is a fairly quick solution, which would involve creating what are called groove templates, which alter the timing of a note or percussion hit based on its position in the meter in order to impart a human feel to the phrase. (Randomization alone doesn’t help much in this regard; a good groove is actually systematic in its timing deviations). I have a feeling that groove templates ignore a lot of the factors that influence expressive timing in expert performances, such as location in a phrase, inter-onset interval, and in the case of pitched music, harmonic stability and melodic motion. For this reason I’ve held off an incorporating expressive timing into my performances so that I can develop a more elaborate model, which will probably be based on regression analysis. I’ve got some good MIDI data of conga and bongo performances to model, but pre-processing that data is a large project in itself.
It’s great to have people to discuss these ideas with. I’m not in school anymore, and the man on the street doesn’t want to hear about my Arduino code, which is probably a good thing. Let me know if the comments net is too restrictive; I believe first-time comments are held for approval, but otherwise you should be able to comment at will.