Voltage to frequency
A quartz crystal resonator (a crystal) oscillates at one specific frequency called its fundamental. If you want a 40kHz signal, you buy a 40kHz crystal. You can sometimes make a crystal oscillate at multiples of its fundamental, ie 80kHz, 120kHz, etc. but you cannot easily adjust a crystal to give a frequency in a range such as 40kHz to 44kHz. To do that you need a circuit or an IC called a Voltage Controlled Oscillator (VCO). As its name suggests, by changing the voltage you input to the VCO you will change the frequency it oscillates at. The voltage that you need to input for a specific frequency depends on the design of the VCO.

Have a look at https://en.wikipedia.org/wiki/Voltage-controlled_oscillator