How to convert musical tones to frequencies