How to generate such sounds as in example? I found these files on Internet:

1.wav
2.wav
3.wav
4.wav

How to generate such sounds?

Geno Chen wrote "Acoustic Grand Piano (Instrument #0)"

What to do next?
https://ccrma.stanford.edu/

There is a Center focused on Music and Acoustics at Stanford University and their website has many resources. There are several papers on computer generation of musical instrument sounds.