The basic circuit is an op-amp relaxation oscillator:
There already exists a lot of documentation online for this circuit:
Design and Implementation of Opamp Relaxation Oscillator by Md. Moyeed Abrar
Relaxation Oscillator Circuit by TI (SNOA998)
The basic idea is that the op-amp compares the rising and falling voltage of the cap with the reference voltage set by the voltage divider from the output. The output is always at one of the rails, so the reference voltage is always the same magnitude (assuming ± voltage rails). The RC time constant sets the cap voltage slew rate, and the voltage divider sets the point the cap voltage has to reach before the output toggles.
We can change the frequency by changing either the ratio of the voltage divider or the RC time constant.
Here's the final schematic.
- pressing one of the buttons will put a different value resistor in the RC circuit, which will play a different frequency
- Changing R19 will change the frequency of every note, so you can shift the entire octave
- Component values were based on breadboard tests
The R18,19,20 circuit that provides V+, as well as the value of the 160Ω resistors and 1k pots were all tested on the breadboard to give a frequency range of 76 - 2380 Hz. I was happy with this since higher frequencies start to get annoying, and adding more range would make it harder to set precise frequencies and tune properly.
One of the main factors in choosing components was price. I looked at a few websites and found that while the selection at Tayda Electronics wasn't as wide as Digi-Key, their prices were much lower. I was able to buy the more expensive components, like the driver and pots, at a much cheaper price than I thought possible.
The voltage regulator has a drop out of ~360 mV @ 50 °C.