New tone generation algorithm. Lots of old changes I do not remember.