Frequency Measure

Your specification is not exactly clear. Do you mean that you want to continually read an ultrasonic sensor and then create sounds using a separate buzzer (which you didn't mention)? And the frequency of the buzzer sound should vary depending on the pulse width returned from the ultrasonic sensor?

Steve