Now you get everything connected. You can use Max/MSP
to process all these informations in order to send midi to any instrument.
You can download my patch attached.
I explain the code inside the patch.
For those who are not familiar with Max MSP, I am sorry I don't go very deeply into the instructions. But you can download a demo version on the Cycling74 website
and everything will be fine.
Basically, you just have to run the Arduino code, then click on the start button in Max MSP and select the midi port in the list ("from Max 1" for instance). If you receive something you should see the graph and the slider moving.
For the percussion part, set your sound input to Built-in-input (on Mac) and you will see the bang object blinking when you hit the piezzo. That mean it send a midi note on the channel 2.
This patch is really raw and must be improved. For instance as the frequency shift of the Theremin is logarithmique, I should handle these values exponentially.