title: Arduino - How to create two or more tones simultaneously on a piezo buzzer?
body: <p>My high school electronics class decided to buy some arduino uno kits, which I must say are extremely cool. Enough about that, right now in the class we're experimenting with the piezo buzzer (it looks like <a href="https://content.solarbotics.com/products/photos/93c51bd69dcc15a0f60bb6bb4c96d4df/lrg/17855-dscn3894.JPG" rel="noreferrer">this</a>). We learned about creating songs using the piezo buzzer. Our teacher told us to be "creative". What better way to be creative than to use "Firework" by Katy Perry.</p>
  
  <p>Using some creative liberties, I found a nice piano piece of this song (link <a href="http://www.scribd.com/doc/58731379/Fireworks" rel="noreferrer" title="here">here</a>). Now I'm a piano player (I took AP Music theory), and the problem I'm having is that I'm only able to play one note only the piezo buzzer. Is it possible to play the song on a piezo buzzer so it sounds like it's being played on a piano (or at least close to). I mean like the bass and treble clef notes are played simultaneously on the buzzer. </p>
  
  <p>I understand that it involves phase shifts and adding frequencies of notes, but how do you translate this into code for a piezo buzzer? If you could post some example code that would be greatly appreciated. If not, could you explain it in the clearest way possible. I'm not a master at programming, but I'm not a beginner either.</p>