How to generate such sounds as in example?
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.