Algorithm to change an already sampled guitarstring to sound like it was a bit damped by the hand
Here is one thing to try: Guitar wave form typically has a sharp on set (the "pluck"), followed by some ringing. You could write an onset or transient detector that finds these onsets. Once you have one, apply a fast exponential decay to the waveform to make the ringing a lot shorter. Find the next onset and repeat. You probably also want a mild low pass filter, just something with negative frequency slope to simulate that the palm damps higher harmonics more than lower harmonics.