February 22, 2010

Circuits, Solenoids, Microtiming

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.


Comments (4)

Bonnie Blodgett

February 22nd, 2010 at 4:46 pm    

I don’t have a thing to suggest regarding your Ardino code. Just wanted to tell you your music is wonderful and addictive. So…

Got to get back to it. . . can’t stop listening, watching, whatever.

Seriously, this is an awesome achievement.

Bill Wetzel

February 26th, 2010 at 6:21 am    

Wow! You have done some great work here. Enviable. A few things…

1) I wouldn’t worry the slightest about the response time of the opto-couplers, which is measured in tens of nano-seconds. That a million times faster than the response of the solenoids, which is probably in the many tens of milliseconds range at the fastest.

2) Many years ago a friend of mine replaced the pneumatics in a player piano with solenoids so that he could drive it from an electrical tracker (the roll reader). At one point in the development he had an electrical noise problem. One solenoid would fire intentionally. That generated a noise spike that would fire a few others and those in turn several more with the result that all 88 solenoids appear to fire at once. What a noise! I thought the entire piano was about to fall over.

3) You might check eBay for solenoids. I have see them there and sold some there myself several years ago.

Good luck with your work,
Bill Wetzel

Bill Wetzel

February 26th, 2010 at 6:23 am    

One more thing. I like the idea of the opto-couplers in the circuit. The provide isolation from the sensitive computer circuits of the Arduino and the power circuits of the solenoids and drivers.


February 26th, 2010 at 4:13 pm    

Yeah, I think opto is used in compressors because the response curves are not completely linear.

Leave a reply