How can I generate PWM sounds?

:)I implemented 3 channels polyphonic piano. 1 speaker outputs 1 notes and I have 3 switches and 3 notes.

To synthesize waveforms to one, sinewave is better@@ :’(, am I right?
But now I only have 3 squarewave outputs. Actually I want to combine 3 channels to single channel, PWM is a good way to let me do this, but how?

I read many articles and codes in this forum but many are so complicated, mostly I can’t understand them><. then I read playground about PWM ( timers ), acoording to it, I wrote followings:

#include <Tone.h>
#include "TimerOne.h"
 
Tone mmm;

int key = 2;
int set = 0;

void setup()
{
  mmm.begin(9);
  Timer1.initialize(500000);         // initialize timer1, and set a 1/2 second period
  Timer1.pwm(9, 512);                // setup pwm on pin 9, 50% duty cycle
  Timer1.attachInterrupt(callback);
  pinMode(key, OUTPUT);
    digitalWrite(key, HIGH);  // attaches callback() as a timer overflow interrupt
}
 
void callback()
{
  digitalWrite(9, digitalRead(9) ^ 1);
}
 
void loop()
{
  set = digitalRead(key);
  if(set == LOW){
    mmm.play(NOTE_FS4, 20);}
}

Certainly it is wrong, I know!!!
Can anyone give me some instances? :-X
THANK YOU@@

Finally, I want to ask what differences can I hear both of SQUARE and SINE WAVES???

I have just discovered 3 channels(notes) can output to 1 speaker at the same time..