The Legend of Zelda: Ocarina of Time features 12 songs that you can learn to play on the Ocarina (plus an 13th hidden song). These great melodies are full of power and mystery, and are required throughout the game to effect certain changes and allow Link to progress further in the story.
There are 6 songs that you learn as Young Link, and 6 that you learn as Adult Link, and the songs can be played on either the Fairy Ocarina instrument or the Ocarina of Time instrument (which replaces the Fairy Ocarina once you receive it). There is also one hidden song that you can learn which does not appear on the subscreen that shows the list of songs you have learned, you’ll need to keep it in memory.
Here is a list of all the songs and how to get them:
Zelda’s Lullaby
Location: Hyrule Castle (Given to you by Impa, Princess Zelda’s Attendant)
A mystical song passed down by the Royal Family of Hyrule, this song is taught to you by Imp the first time you meet her at Hyrule Castle after sneaking in. You can play Zelda’s Lullaby to prove that you are lineage of the Royal Family, and you will be required to play the song whenever you see a Triforce symbol (on the floor or wall, for example).
You can also use Zelda’s Lullaby to make some other nifty things happen, such as fixing broken wooden signs that you’ve slashed, making Fairy’s appear at points where Navi turns green, and changes the water level of the Water Temple.
Here is how you receive the song in the game, including how to break into the Castle and get passed the guards.