Roman, I tested your [solenoiduino] patch and it doesn't quite do what i expected. But i think i can expand on this idea.
So, right now you send the pin number and the amount of ms you want it to be HIGH, but what if you don't know how long it will be? for instance a live performance situation. Using this technique you can send a short pulse to achieve some dynamic control, but you can't hold a piano key down, for example, because the pulses will always be full power.
I need to check if I can modify the solenoiduino firmware to receive the second byte as 'velocity' instead of 'duty cycle' and use that for pwm control. I'll let you know how it goes.