Length of wire from one end only
If I understand correctly, you are trying to get guitar notes played in real time - and you'd like to use an Arduino.

Here is a project where I used the Lorentz force to get guitar notes played...

http://wp.josh.com/2015/07/28/self-strumming-ghost-guitar/

I have successfully used an Arduino to control the strings by using a large MOSFETs connected to the Arduino digital outputs. 

To minimize attaching stuff to the guitar, you can electrically connect all of the strings together at the bottom so individual connections are only require at the top by the pegs.