It's easy to do a fourier analysis, and add up the fourier coefficients.
But the result doesn't sound that much like the instrument. And adding an ASDR (Attack-Decay-Sustain-Release) type envelope doesn't help. The problem is that the spectrum keeps changing. New partials appear, old ones disappear, and you have non harmonic sounds like clicks and fret noises and the thump of piano keys and clatter of the piano mechanism and the sound of the breath of the player etc which are part of the sound. We don't normally notice those, but leave them out and it doesn't sound real.
It's quite fun as a way of making new sounds. I worked on that for my Tune Smithy program. Use harmonic spectrum of one instrument, and play it with the volume envelope of another. Another fun thing you can do is to take the spectrum of say a piano - and volume envelope of a piano, and then play all the partials on bassoons at correct volume all the way through and pitch :). Creates a new sound somewhere between a piano and a bassoon in quality. I did that just with midi instruments, would be fun to try it with real instruments, like a bassoon ensemble simulating the sound of a single piano note.
But - it doesn't sound much like the original acoustic instrument.
If you want it to sound like an acoustic instrument there are three main methods used
Acoustic modelling. You use physical insights into how the sounds are produced to create a model of that sound (simplest is the Karplus Strong algorithm, a simple algorithm that simulates a plucked sound). Virtual piano, physically modelled acoustic and electric pianos is a good modern example.
Wave table - you record the beginning, the end, and in between you use a looped part of the sample. Was used in the past a lot mainly because it requires less memory, so you can hold everything in memory - when disk space was limited and streaming from disk was slow. You can have separate samples (sections from the original recording) for the attack, the decay and release, and the sustain.
Complete sample - this is the most usual approach nowadays if you want it to sound like the "real thing". Just record lots of notes - typically e.g. a 'cello player is employed to play thousands of notes on their instrument at different volumes, every pitch of note they can play, and different styles of playing. Even then it doesn't exactly reproduce the almost infinite variation of possibilities for a real performance, but it gets close. High end example Vienna Symphonic Cube.
If you want to use something like Fourier Analysis you can use wavelet analysis because that has a time component to it and may capture how the harmonics change with time.
But I don't know of anyone who has created virtual instruments using wavelets. Maybe they have - do say in comments if anyone knows of a wavelet approach to creating virtual instruments to sound like the acoustic originals.
I'm not sure what is the best program to recommend for spectrum analysis. I wrote this long ago, aim was to find the frequencies of the peaks as exactly as possible, but it was fiddly to use and needed a lot of manual intervention. Sounds Harmonic Analysis. Some time I plan to work on it some more but there must be other good tools.