They said that the play() function is non-blocking without the duration variable, but to play the proper notes at the right time, I will need to use the duration variable. Is there any way around this?
You can either stop the playing on demand or wait until the durations have expires:
tone1.play(NOTE_C4);
tone2.play(NOTE_A4);
delay(noteDuration);
tone1.stop();
tone2.stop();
tone1.play(NOTE_C4, noteDuration);
tone2.play(NOTE_A4, noteDuration);
while (tone1.isPlaying() || tone2.isPlaying())
/* Do nothing else while the tones are playing */ ;
Note: From the documentation it appears that .play() is NON BLOCKING even if duration is specified. The function returns immediately but the tone will continue until the duration expires.