How to switch on/off ungrounded circuits using a transistor
When using a transistor as a switch, the "switching action" depends on the voltage between the base and emitter (or gate and source for a FET).  But in your circuit the emitter voltage is a varying analog signal.  This makes producing the correct base drive difficult.

Enter the analog multiplexer, an IC designed specifically to switch a varying analog signal with a DC control signal.  There are many to choose from, but the lower cost parts probably will not work well in your circuit.  All analog switches have an input-to-output resistance when "on", which will affect the frequency (for the capacitor switch) or waveform shape (for the tri/sine switch).  Do some reading on analog switches and multiplexers and see if they will work for you.