Karplus-Strong algorithm