Playing two tracks with one speaker

I want to be able to play basic musics with my speaker, but sometimes I would need two play two tracks at once (left and right hand) and I have no idea how to do it. Right now I can't play two note at once, only one. So I thought about "mixing" the two PWN waves into one. Would that achieve the desired effect, if not what would? Is it possible with Arduino?

Sure, run each track thru 1K resistor before feeding into the amplifier.

The amplifier, do you mean the speaker or I need to buy another part?

Croutonix:
I want to be able to play basic musics with my speaker, but sometimes I would need two play two tracks at once (left and right hand) and I have no idea how to do it. Right now I can't play two note at once, only one. So I thought about "mixing" the two PWN waves into one. Would that achieve the desired effect, if not what would? Is it possible with Arduino?

Basically, you need to "mix" the two signals. Easy way would be to feed both signals into a summing amplifier if you want to take the analog method of doing it.

Look at the schematic and youtube video here - 8 tone-type outputs from Arduino played thru a single self-powered/amplified computer speaker
http://forum.arduino.cc/index.php?topic=179761.0
Pick one up for a couple bucks if you don't have a set from an old desktop around already
http://www.parts-express.com/cat/multimedia-computer-speakers/3406

And how do I generate two waves at once?
Currently I do:

while (elapsed_time < period) {
// write high
delay(period/2)
// write low
delay(period/2)
}

Look at my code, just a big example of multiple occurrences of blink without delay, with arrays to keep track of things. With a '1284P, it's set up for up to 13 notes. Drop 5 off for a '328P, do 8 notes with a push button per note.
Key is "without delay" tho.

I just checked your code but I don't really understand.
Are the tracks merged in the software or in the hardware?
If it's software-merged, how do you do it?

EDIT: Just wrote that, could it work? I sum the two pulses then output it with analog.

int nbPeriod = 2;  // Number of sounds
int period[2] = {100, 200};  // Periods of the different sounds
long elapsed_time = 0;
long time = micros();
while (true) {
	// Get whether pulse is high or low for each one and sum them (merge them)
	int sum = 0;
	for (int i = 0; i < nbPeriod; i++) {
		sum += round((elapsed_time % period[i]) / period[i]);
	}
	sum = sum / nbPeriod;  // Get sum between 0 and 1
	
	analogWrite(speakerPin, sum*255);  // Output
	elapsed_time += micros() - time;  // Increase elapsed time
}