The first section of this program is a function we have called play note
. This function
accepts one input which is set as the frequency for the sine wave generator WG. It then waits for 0.1 Seconds.
In the subsequent sections, we have prepared a list of frequencies corresponding to the notes for a song. A frequency of 0 turns off the since wave, and indicates a pause. If a frequency is repeated twice, it means it will play for 0.2 seconds before the next frequency gets set.