Click the green flag to hear a tone. Adjust the slider to change its frequency! This project uses the pitch effect to change the speed of a preset sound and make it play arbitrary tones.
Huge thanks to this answer on the Scratch discussion forums for converting playback speed to pitch effect: https://scratch.mit.edu/discuss/post/6017731/ Then the playback speed is found by dividing the desired tone by the pitch of the preset sound.