ADSR working in Guitar Help :)

The way to add sustain is to amplify the signal inversely to the magnitude of the signal. That is probably easier to do in with analog signals, although it can be done with digital signals IF you have a fast enough processor. To get reasonable sound quality you will need a faster processor (and A/D) than a 16 MHz ATmega.