updating output frequency and tone generation algorithm