Right now I'm using a simple low-pass filter of resistors in series and capacitors in parallel to change the square wave of the tone function into a sine wave. Afterwards I have a simple amp using the LM386. For the amp I'm just following the suggested circuit in the LM386 datasheet:
I was hoping to also invert the polarity every half cycle, using the 2N2222, as described in this thread: Reversing polarity so as to fully drive a piezo speaker? - #13 by LarryD
The relevant circuit is here: https://aws1.discourse-cdn.com/arduino/original/4X/7/3/2/73244ea2060a271b91e3b9f24d99f7194bb48764.png (Sorry, I tried to insert the image directly, but it wouldn't let me as a new user.)
While I think the low-pass filter can be placed into this 2N2222 circuit so long as I'm not using electrolytic capacitors, I want to be able to use electrolytic capacitors. Polarity also pretty clearly matters on that LM386 circuit.
I want to invert the voltage for better quality sound. The tone function is fine for driving a piezo buzzer, but I assume it's not the best for controlling a real speaker driven by induction. Am I just wrong---is it fine to drive a speaker with the tone function?
Is my analysis correct that I can't combine these three circuits (the 2N2222 inverter, low-pass filter with electrolytic capacitors, and the LM386 amp) together?
Is there any way at all to combine an inverter, low-pass filter, and amp to get the tone function to produce an amplified alternating voltage sine wave?