This is a collection of sketches to rapidly use sensors for midi control. You need the MIDIUSB library and an Arduino that supports it, like micro or Leonardo. Here are also some pics of the prototypes i made with those sketches:

This is for using it with piezos (already successfully used live on a drumkit):

And this for with capacitive sensors (it just sends notes as triggers):

--->get it on github<---